Archived

This topic is now archived and is closed to further replies.

RizMan

Fullscreen with SDL

Recommended Posts

I am having trouble bringing my OpenGL application to fullscreen using SDL. When hitting the F1 key, SDL_WM_ToggleFullScreen is called. However, it won''t change to fullscreen.
  
void ToggleFullScreen(void)
{
    if(SDL_WM_ToggleFullScreen(MainWindow) == 0)           
    {
        cerr << "Failed to Toggle Fullscreen mode : " << SDL_GetError() << endl;   
		printf("error");
        Quit(0);
    }
}
  
That''s what I''m doint. I indeed get the error message, so SDL can''t change to fullscreen. I am using Win32. I read somewhere that this only works on X11 but somehow coudln''t believe it. Anyone knows if that''s true and if yes: Can I at least use GLUT to change to Fullscreen?

Share this post


Link to post
Share on other sites
According to the SDL docs SDL_WM_ToggleFullScreen is only available under X11.
You can try using SDL_SetVideoMode, as suggested by tamatito in the doc page, instead to recreate your main window surface using the appropriate flag (SDL_FULLSCREEN).

[edited by - baumep on March 2, 2003 6:02:33 PM]

Share this post


Link to post
Share on other sites
In fact, I highly suggest you do NOT use that function. Even under X11, it has problems. I found that it was MUCH easier to simply write my own that did a brand new SetVideoMode.

(oh, and the problem i was having was that I only had a few video modes to work with and when using that function, it switched to the next-highest mode and displayed itself in a box in the middle of the screen. I was using openGL, so I didn''t care about resolution. I enumerated available modes and resized to the bigger size myself. tadaa! no more window in the middle surrounded by black, a nice fullscreen instead.)

Share this post


Link to post
Share on other sites