[SDL] OpenGL trouble in Windows

gtxayf1q001 at sneakemail.com gtxayf1q001 at sneakemail.com
Sun Sep 8 11:25:01 PDT 2002


Anyone around who has been using SDL_OPENGL|SDL_FULLSCREEN
and SDL_OPENGL|SDL_RESIZABLE? And toggling between the two?

SDL_WM_ToggleFullScreen() unfortunately does 
not work in Windows, but it seems easy to use 
SDL_SetVideoMode() instead. AFAIK, this code should
do the trick. Anything else that should be done?

if(!SDL_WM_ToggleFullScreen(surface))
{
  if(SCREENFLAGS & SDL_FULLSCREEN) {
    SCREENFLAGS = SDL_OPENGL | SDL_RESIZABLE;
  }
  else {
    SCREENFLAGS = SDL_OPENGL | SDL_FULLSCREEN;
  }
  surface = SDL_SetVideoMode(SCREENWIDTH, SCREENHEIGHT,
                             SCREENBPP, SCREENFLAGS);
                             
  initGLStuff(SCREENWIDTH, SCREENHEIGHT);
}

And window resize:

if(event.type == SDL_VIDEORESIZE)
{
  surface = SDL_SetVideoMode(event.resize.w,
    event.resize.h, SCREENBPP, SCREENFLAGS);

  initGLStuff(event.resize.w, event.resize.h);
}


The problem is that while this works fine on my computer,
for example a Win98/Voodoo3 2000 one doesn't like it at
all. Resizing the window segfaults randomly. Switching
from windowed to fullscreen works, but switching back
gives a black window and segfaults when mouse is moved.

Any ideas or experiences? Might be a driver problem, but
then, some non-SDL OpenGL programs can do the same just fine.






More information about the SDL mailing list