Jump to content
  • Advertisement
Sign in to follow this  
CMuYu

OpenGL How to hide the window generated by OpenGL

This topic is 2013 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Edited by jbadams
Restored post contents from history.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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. :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!