Skip to content

Instantly share code, notes, and snippets.

@paulhayes
Created October 31, 2016 12:04
Show Gist options
  • Select an option

  • Save paulhayes/88e1c0fc0c111706e0ab0ebe5d7f366e to your computer and use it in GitHub Desktop.

Select an option

Save paulhayes/88e1c0fc0c111706e0ab0ebe5d7f366e to your computer and use it in GitHub Desktop.
/*
* I've recorded this because it would be very useful when using shaders to do computation for game mechanics or effects.
* For instance I've made a shader based terrain deformation system, but it doesn't have physics. That's now possible
* while still being effcient
*/
[DllImport("opengl32")]
public static extern void glReadPixels (int x, int y, int width, int height, int format, int type, IntPtr buffer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment