In a kind of light video game developped in Java using lwjgl I use glReadPixels() in order to get the object the user is aiming with the mouse (all the objects are associated with one color). It works fine on my Windows but the program crashes without raising any exception when I call glReadPixels() on my Ubuntu. I've read some topics about similar problems due to an incompatibility between some graphic drivers and an ancient version of mesa. Does anyone know if there are similar problems with lwjgl ? Any idea about what's wrong with this ?
Here is the piece of code :
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
display();
GL11.glFlush();
ByteBuffer pixels = BufferUtils.createByteBuffer(3);
GL11.glReadPixels(WIDTH/2, HEIGHT/2, 1, 1, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, pixels);