Zbuffer

Is there anyway to get a pointer to the Zbuffer or in any other way directly access it.

You can’t obtain a pointer to the ZBuffer.

The only thing you can do is read it by using glReadPixels with GL_DEPTH_COMPONENT for the “format” parameter.

Basically, you can not have any pointer to any OpenGL buffer. glReadPixels is the only way to go (but big WARNING : it is very slow !).

By the way, if you want to write pixels, use glDrawPixels or glCopyPixels.

Eric