Advertisement

Hiding OpenGL window in SDL

Started by May 01, 2011 03:28 PM
4 comments, last by jmakitalo 13 years, 6 months ago
Hi, is it possible to hide an OpenGL window once it has been created with

SDL_SetVideoMode(wndWidth, wndHeight, 0, SDL_OPENGL | SDL_RESIZABLE |)

I have been googling this but have not found a working solution. Most of game data in my program
can be loaded only after the window has been created (OpenGL textures etc.) and I want the user
to see the console messages during the load, not a blank window. Thanks in advance.
If SDL can't hide a window, maybe there is a way to set the focus on the console window so it is visible.
Advertisement
Just had an idea while working on my own event poll but it doesn't sound like it will work. I thought you could SDL_PushEvent an SDL_ActiveEvent but it sounds like it just copies this event into the event queue instead of creating the event.

http://wiki.libsdl.org/moin.cgi/SDL_ActiveEvent
http://wiki.libsdl.org/moin.cgi/SDL_PushEvent
1. How about just resizing the window so it's very small?

2. This isn't how games normally display these messages -- they render them to the game window...

3. SDL_WM_LowerWindow() -- this requests the window be "lowered". It ought to put it behind your console window. There's a Raise to bring it back after the load has finished.
4. SDL_WM_IconifyWindow -- SDL draws naming conventions from X11 in places. An "iconified" window in X11 is akin to a minimised one in Windows. There'll be one to bring it back afterwards.

1. How about just resizing the window so it's very small?

2. This isn't how games normally display these messages -- they render them to the game window...

3. SDL_WM_LowerWindow() -- this requests the window be "lowered". It ought to put it behind your console window. There's a Raise to bring it back after the load has finished.


1. A bit of a hack. Also, I'm not sure that openGL window can be resized so that the context remains intact (textures etc.).

2. I think it still fits the mood of linux to display the loading messages in the regular terminal. Might scare the windows users, but I don't mind.

3. The iconification works ok. I tried to google for the function to bring up the window again, but didn't find it yet. Can you remember what it is?

Thanks for your replies. It is kind of odd that there doesn't seem to exist a direct way to hide the window.

This topic is closed to new replies.

Advertisement