Missing extension (pixel_buffer_object)

Hey guys,

So I’m trying to use gl.glReadPixels to do some occlusion testings and I get a following error:

Exception in thread "Thread-2" javax.media.opengl.GLException: javax.media.opengl.GLException: 
pack pixel_buffer_object must be enabled to call this method
at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:271)
...............

Now I tried to enable that extension using gl.glEnable(GL.EXT_pixel_buffer_object) or something like that, but there is no such extension, or at least the API doesn’t specify it.

Also when I run this:

String extensions = gl.glGetString(GL.GL_EXTENSIONS); 
System.out.println(extensions);

I get the GL_EXT_pixel_buffer_object listed in there.

Any help would be appreciated.

Thanks.

glReadPixels has two different methods, one that takes an int and another that takes an nio Buffer. If you use the int version, the int is treated as an offset in bytes into the currently bound pixel pack buffer object (like a vbo, and is stored on the graphics card). It’s illegal to call this if no pbo is bound, similarly you can’t call the Buffer version if a pbo is bound.

You’ll just have to switch your code to call it with a buffer, and make sure that the buffer has been rewound before passing it into the function.

If you’re using the buffer version, then we’ll have to see your drawing code to know what you’re doing.

That was the problem. When i changed to buffer the error went away and the code works as expected.

Thank you.