How to hide the image generated by OpenGL

Hello, I’m a Chinese. I’m sorry that my English is not good.
I want to make OpenGL to be a image generater work in backstage, I don’t want to display the image generated by it.
How to hide the image or not generated the image?
Thank you, every one!

I use windows to be my platform

Use a framebuffer object (ARB_framebuffer_object) to render to a texture. After that, just use GetTexImage to get its content.

Thanks for answering me. Do you have some easier ways to solute this question? I’m a beginner and the way you recommand is a little hard to me.
Before that my way was to hide the window by using the windows API, but it didn’t work.
Thanks

Before that my way was to hide the window by using the windows API

This does not work because Windows is clever enough to know the window is not visible and clip the output to nothing. You have to use an offscreen frame buffer if you don’t want the window to seen.

A few other ideas. 1) Allocate a double-buffered window, only draw to the back buffer, and never swap buffers. 2) Allocate a GL context to draw to a pbuffer instead of a window. Seems like that was the old method prior to FBOs.

That said, FBOs are pretty easy.

Allocate a double-buffered window, only draw to the back buffer, and never swap buffers.

The pixel ownership test doesn’t care about single or double buffers. If the screen pixel isn’t owned by the window, then the pixel ownership test fails and the pixel’s value is undefined.

You have to use some off-screen mechanism.

[QUOTE=Alfonse Reinheart;1249108]The pixel ownership test doesn’t care about single or double buffers. If the screen pixel isn’t owned by the window, then the pixel ownership test fails and the pixel’s value is undefined.

You have to use some off-screen mechanism.[/QUOTE]
Does it mean FBO is the only way? I will learn it. Thanks

I want to ask that, can I use glReadPixels instead of glGetImage?

In fact I don’t want to display the window. But once the “glutCreateWindow” excute, the window is created.
In addition, I don’t know how to read information from a FBO, “glReadPixels” didn’t work. How to use “glGetImage”?
Thanks!

“glReadPixels” didn’t work

How about you post the code that “didn’t work” so that someone can tell you why it didn’t.

How to use “glGetImage”?

There is no “glGetImage”. There is a glGet[b]Tex[/b]Image function, but that works for textures.

[QUOTE=Alfonse Reinheart;1249307]How about you post the code that “didn’t work” so that someone can tell you why it didn’t.

There is no “glGetImage”. There is a glGet[b]Tex[/b]Image function, but that works for textures.[/QUOTE]
Yeah, it’s “glGetTexImage”. I want to read the whole information, not just textures information.
I don’t want to let the window appear. Do you have some good idea?