Newbie question: Destroying/Recreating window

Hi,
as a bloody SDL newbie I wonder there are no functions to recreate or close a
window. So I would like to ask if I’m on the right way?

In my program the application does not close the window. That’s because I
have a object orientated engine design, so my engine window-subsystem is
supposed to do this. As far as I know from SDL 1.2 documentation + source
code + some helping guys on IRC channel #SDL:

  • SetVideoMode could recreate my window
    (e.g. user choose another screen resolution at runtime)
  • SDL_QuitSubSystem could close my window
    (e.g. shutting down my window subsystem class)
    Maybe it’s a good idea to add a SDL_DestroyWindow() function to SDL? As far as
    I heared on IRC some Win32 drivers have problems with unloading and
    again reloading the SDL video subsystem.

Another thing in mind: You do not call SDL video functions together with a
handle to the window surface. Hmmm, so how does the SDL video subsystem
knows which window you mean, especially if you have multiple threads using
the video subsystem? Yes, kinda constructed problem, but thought for deeper
understanding of SDL.

Let me say sorry, for asking newbie questions! :)–
Thx, Moak

SDL might not be what you need because you cannot have more than one window and you cannot call any video functions from separate threads.

-JakobOn Tue, Nov 06, 2001 at 10:13:32PM +0100, Mark Seuffert wrote:

Another thing in mind: You do not call SDL video functions together with a
handle to the window surface. Hmmm, so how does the SDL video subsystem
knows which window you mean, especially if you have multiple threads using
the video subsystem? Yes, kinda constructed problem, but thought for deeper
understanding of SDL.

Let me say sorry, for asking newbie questions! :slight_smile:

Hi,
as a bloody SDL newbie I wonder there are no functions to recreate or close a
window. So I would like to ask if I’m on the right way?

In my program the application does not close the window. That’s because I
have a object orientated engine design, so my engine window-subsystem is
supposed to do this. As far as I know from SDL 1.2 documentation + source
code + some helping guys on IRC channel #SDL:

  • SetVideoMode could recreate my window
    (e.g. user choose another screen resolution at runtime)
  • SDL_QuitSubSystem could close my window
    (e.g. shutting down my window subsystem class)
    Maybe it’s a good idea to add a SDL_DestroyWindow() function to SDL? As far as
    I heared on IRC some Win32 drivers have problems with unloading and
    again reloading the SDL video subsystem.

Another thing in mind: You do not call SDL video functions together with a
handle to the window surface. Hmmm, so how does the SDL video subsystem
knows which window you mean, especially if you have multiple threads using
the video subsystem? Yes, kinda constructed problem, but thought for deeper
understanding of SDL.

Let me say sorry, for asking newbie questions! :slight_smile:

Nope, these are very good questions.
The short answer: SDL 1.2 is designed for a single window.
All the points you address are being considered for the SDL 1.3 rewrite.

See ya!
-Sam Lantinga, Software Engineer, Blizzard Entertainment