Hi
I’m sorry to disturb you with this, the email address of the author of this port is no more valid. You can find the example here:
http://nehe.gamedev.net/data/lessons/lwjgl/lesson32.jar
The depth values in the select buffer are unsigned 32-bits integer and are stored into signed 32-bits integer. Of course, when the depth is greater than 2^31, the source code stores a negative value.
The actual code is:
temp = ByteBuffer.allocateDirect(2048).asIntBuffer();
GL11.glSelectBuffer(temp); // Tell OpenGL To Use Our Array For Selection
temp.get(buffer);
hits = GL11.glRenderMode(GL11.GL_RENDER); // Switch To Render Mode, Find Out How Many
// Objects Were Drawn Where The Mouse Was
if(hits > 0) { // If There Were More Than 0 Hits
int choose = buffer[3]; // Make Our Selection The First Object
int depth = buffer[1];
The last line should be modified:
long depth = buffer[1] & 0xffffffffL;
Best regards.