Programmatical read of the finished image

I create openGL image render it to the window and apply bytes reading using function glReadPixels(). The image is read in the buffer and I can edit it or convert into different format. Is there a way to obtain same image without painting it in the window and even without creating the window.

What you are looking for is called offscreen rendering.

Currently you can do that with pbuffers. The spec can be found here .
This allows you to render to an offscreen buffer, thus eliminating the need for a visible window (which is required for the ReadPixel approach).

However, note that WGL_ARB_pbuffer is an extension, and like all other extensions, you must initialize it before using it.
To do so, you need a rendering context, which in turn means you have to create an opengl-capable window.

Thank you for reply. I’ll investigate new opportunity. Your answer, however, did not say clearly if I can get rid of any visible window and have same image built and saved in the buffer, but I presume it is possible.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.