Jump to content

  • Log In with Google      Sign In   
  • Create Account


How to hide the window generated by OpenGL


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 CMuYu   Members   -  Reputation: 108

Like
-1Likes
Like

Posted 27 March 2013 - 02:22 AM

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!



Sponsor:

#2 C0lumbo   Crossbones+   -  Reputation: 2120

Like
3Likes
Like

Posted 27 March 2013 - 02:54 AM

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



#3 Olof Hedman   Crossbones+   -  Reputation: 2654

Like
0Likes
Like

Posted 27 March 2013 - 03:10 AM

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



#4 CMuYu   Members   -  Reputation: 108

Like
0Likes
Like

Posted 28 March 2013 - 07:32 PM

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!



#5 CMuYu   Members   -  Reputation: 108

Like
0Likes
Like

Posted 28 March 2013 - 07:35 PM

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.



#6 CMuYu   Members   -  Reputation: 108

Like
0Likes
Like

Posted 28 March 2013 - 07:40 PM

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.



#7 Vortez   Crossbones+   -  Reputation: 2688

Like
1Likes
Like

Posted 02 April 2013 - 11:52 PM

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


Edited by jbadams, 04 April 2013 - 05:41 AM.
Restored post contents from history.


#8 PandaDragonThing   Members   -  Reputation: 311

Like
0Likes
Like

Posted 05 April 2013 - 04:26 AM

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.



#9 Katie   Members   -  Reputation: 1283

Like
1Likes
Like

Posted 05 April 2013 - 06:17 AM

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



#10 CMuYu   Members   -  Reputation: 108

Like
0Likes
Like

Posted 16 April 2013 - 07:49 PM

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



#11 CMuYu   Members   -  Reputation: 108

Like
0Likes
Like

Posted 16 April 2013 - 07:56 PM

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

Thanks. In china google is not so powerful. :)






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS