How to hide the window generated by OpenGL

Started by
9 comments, last by CMuYu 11 years ago

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 window generated by it.


How to hide the window or not generated the window? I just want to get the image.


Thank you, every one!

Advertisement

I don't think OpenGL creates windows or has any functions at all relating to window management. Typically, the operating system provides the API for window creation and management and the interface between OpenGL and the window. e.g. On Mac there's the AGL functions (https://developer.apple.com/library/mac/#documentation/graphicsimaging/reference/agl_opengl/Reference/reference.html).

So I think if you want to get useful answers then you need to specify your platform, and whether you are using any sort of cross platform library which may be managing your windows for you (like SFML or SDL).

Using FBO:s, you can draw to an offscreen buffer, and then read out the pixels through glReadPixels, without ever displaying any window.

Using FBO:s, you can draw to an offscreen buffer, and then read out the pixels through glReadPixels, without ever displaying any window.

I had used FBO, but once I excute "glutCreateWindow" , the window must be appeared and with no image in the window. If I comment the sentence, the program can't run.

So, how can I fix it?

Thank you!

I don't think OpenGL creates windows or has any functions at all relating to window management. Typically, the operating system provides the API for window creation and management and the interface between OpenGL and the window. e.g. On Mac there's the AGL functions (https://developer.apple.com/library/mac/#documentation/graphicsimaging/reference/agl_opengl/Reference/reference.html).

So I think if you want to get useful answers then you need to specify your platform, and whether you are using any sort of cross platform library which may be managing your windows for you (like SFML or SDL).

I have used Windows' API "ShowWindow" and setted the parameter "HIDE", but it didn't work . The window is stilled displayed and the image is smaller than before. I don't know why.

I don't think OpenGL creates windows or has any functions at all relating to window management. Typically, the operating system provides the API for window creation and management and the interface between OpenGL and the window. e.g. On Mac there's the AGL functions (https://developer.apple.com/library/mac/#documentation/graphicsimaging/reference/agl_opengl/Reference/reference.html).

So I think if you want to get useful answers then you need to specify your platform, and whether you are using any sort of cross platform library which may be managing your windows for you (like SFML or SDL).

By the way, I will try SFML. Thank you very much.

did you even tried googling it? I've found this, took me about 1 second...

The window you are talking about may be due to what you are using in the compiler and the flags. I know for Code::Blocks theres a flag you have to disable to make that window go away, but right now I can't remember.

Don't use GLUT -- use the appropriate GL toolkit for your platform (GLX, wGL etc) and just don't create a windowed context.

Don't use GLUT -- use the appropriate GL toolkit for your platform (GLX, wGL etc) and just don't create a windowed context.

I have solve the problem. I use the same way as yours. I just use the SW_HIDE parameter to create the window. :)

This topic is closed to new replies.

Advertisement