Created
January 4, 2010 04:56
-
-
Save kritzikratzi/268306 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IntBuffer getsetBuffer = BufferUtil.newIntBuffer(1); | |
// int getset[] = new int[1]; | |
public int get(int x, int y) { | |
gl.glReadPixels(x, y, 1, 1, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, getsetBuffer); | |
// gl.glReadPixels(x, y, 1, 1, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, getset, 0); | |
int getset = getsetBuffer.get(0); | |
if (BIG_ENDIAN) { | |
return 0xff000000 | ((getset >> 8) & 0x00ffffff); | |
} else { | |
return 0xff000000 | | |
((getset << 16) & 0xff0000) | | |
(getset & 0xff00) | | |
((getset >> 16) & 0xff); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment