Toggle fullscreen/window mode

I use this to toggle between fullscreen and window mode

if (SDL_WM_ToggleFullScreen(main_window) == 0) {
cerr << "Failed to toggle fullscreen mode: " << SDL_GetError() << endl;
quit(1);
}

On linux, this works great, I have no trouble switching back and forth, but
under windows, it doesn’t work. Not only that, but SDL_GetError() doesn’t
return anything. Any ideas?

Thanks
/Line72–
12:33:15 up 4 days, 1:48, 1 user, load average: 0.96, 0.56, 0.51

Read the FAQ on http://www.libsdl.org/

This function is only supported under X11 at the moment AFAIK.On Sat, 2003-02-08 at 12:39, Mark D’voo wrote:

I use this to toggle between fullscreen and window mode

if (SDL_WM_ToggleFullScreen(main_window) == 0) {
cerr << "Failed to toggle fullscreen mode: " << SDL_GetError() << endl;
quit(1);
}

On linux, this works great, I have no trouble switching back and forth, but
under windows, it doesn’t work. Not only that, but SDL_GetError() doesn’t
return anything. Any ideas?

Mark D’voo wrote:

On linux, this works great, I have no trouble switching back and forth, but
under windows, it doesn’t work. Not only that, but SDL_GetError() doesn’t
return anything. Any ideas?
You have to call SDL_SetVideoMode(). Here, i have a nice line that
switches fullscreen. It’s the best thing I’ve found
surface=SDL_SetVideoMode(surface->w,surface->h,surface->format->BitsPerPixel,SDL_HWSURFACE|(surface->flags&SDL_FULLSCREEN?0:SDL_FULLSCREEN));