Calling SDL_SetVideoMode multiple times in fullscreen OpenGL/Win32

I know that calling SDL_SetVideoMode when using Win32/OpenGL loses all
textures, and they have to be re-created. But I’m wondering why one
can’t repeatedly call SDL_SetVideoMode while in fullscreen mode.

The application I’m working on switches to a different resolution when
entering debugger mode, and hence calls SDL_SetVideoMode to recreate
the SDL screen (and textures). When it exits debugger mode, it returns
to the previous resolution.

While in windowed mode, everything works fine. But in fullscreen,
calling SDL_SetVideoMode again seems to lock the application. Is there
a way to do this correctly? The same code works perfectly in Linux.

Thanks,
Steve

El mi?, 22-06-2005 a las 23:22 -0230, Stephen Anthony escribi?:

While in windowed mode, everything works fine. But in fullscreen,
calling SDL_SetVideoMode again seems to lock the application. Is there
a way to do this correctly? The same code works perfectly in Linux.

Try doing SDL_QuitSubSystem(SDL_INIT_VIDEO); SDL_InitSubSystem
(SDL_INIT_VIDEO); before calling SDL_SetVideoMode() again. I had some
trouble switching to/from fullscreen and windowed with the DX5 driver,
but this seems to work reliably.

    --Gabriel

Thanks for the advice. I’d already tried that, but it temporarily
switches out of fullscreen mode into windowed, and then jumps back
again. If possible, I’d like it to work like in Linux, where it seems
to stay in fullscreen mode the whole time.

SteveOn June 23, 2005 01:00 am, Gabriel wrote:

El mi?, 22-06-2005 a las 23:22 -0230, Stephen Anthony escribi?:

While in windowed mode, everything works fine. But in fullscreen,
calling SDL_SetVideoMode again seems to lock the application. Is
there a way to do this correctly? The same code works perfectly in
Linux.

Try doing SDL_QuitSubSystem(SDL_INIT_VIDEO); SDL_InitSubSystem
(SDL_INIT_VIDEO); before calling SDL_SetVideoMode() again. I had some
trouble switching to/from fullscreen and windowed with the DX5
driver, but this seems to work reliably.

If possible, I’d like it to work like in Linux, where it seems
to stay in fullscreen mode the whole time.

I have no intelligent answer :smiley: I just can tell you that (sometimes) linux
is just better then windows and microsoft products don’t work good. I also
had problems with (std c !!) things that worked fine on linux but bugged on
windows !–

P.O.M.P.E.I. du 47-20

I realized this a long time ago :slight_smile: But the largest userbase for this
application is Win32, so I need to have it work well there.

I’m convinced that it has to do with the fact that Linux fullscreen mode
is still simply using a window and just changing the resolution.
Whereas in Windows, it’s a whole new screen and new textures. If I
switch away from fullscreen and back again, it sort of works. I’ll
probably end up just making Windows users switch to windowed mode
before making any screen changes, but it’s not the most elegant
solution.

SteveOn June 26, 2005 08:19 pm, Pompei2 wrote:

If possible, I’d like it to work like in Linux, where it seems
to stay in fullscreen mode the whole time.

I have no intelligent answer :smiley: I just can tell you that (sometimes)
linux is just better then windows and microsoft products don’t work
good. I also had problems with (std c !!) things that worked fine on
linux but bugged on windows !