Sign in to follow this  

SDL, OpenGL and fullscreen.

This topic is 4586 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Thanks to some advice I got earlier on this forum, I am not writing my game in SDL/OpenGL. It's great, except that switching to fullscreen is slow and once I start the program, after the window appears and renders everything, it just stalls for about 30 sec. First of all, the fullscreen switching problem. To do this, I just re-initialize the main surface with the SDL_FULLSCREEN flag and I also re-initialize OpenGL because it seems that it resets it. Is there a quicker way to do this? I saw a function, but I heard that it only worked with the X Window System. Last of all, the stall after the window appears. I do not think that this is avoidable, but is there a way to make it less apparent, for example by multi-threading? Thanks in advance. And here are two details that I forgot to mention: -I use Mac OS X 10.2.8 -It doesn't stall everytime. [Edited by - TWizard on May 24, 2005 11:08:40 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by TWizard
Is there a quicker way to do this? I saw a function, but I heard that it only worked with the X Window System.


SDL_WM_ToggleFullScreen. but it does not work for much any more as I've read. So for you, there is nothing that could make it faster, and yes you must reinitialuze everything for OpenGL again on a video mode display change [sad].

As for the stall, create an empty example and see if the stall happens then. If it does, sounds like a Mac problem with the drivers or something like that. If not, then recheck your code. And for some reason, I though it was best to use the SDL_RESIZABLE flag when you reinitialize the screen, but I might be mistaken...

Share this post


Link to post
Share on other sites
Quote:
Original post by PnP Bios
Why are you reinitializing the screen? When you do that, you take your life into your own hands.


Because it's the only way to go to fullscreen mode.

Quote:
Original post by Drew_Benton
SDL_WM_ToggleFullScreen. but it does not work for much any more as I've read. So for you, there is nothing that could make it faster, and yes you must reinitialuze everything for OpenGL again on a video mode display change .


Unfortunately, this is true.

Quote:
Original post by Drew_Benton
And for some reason, I though it was best to use the SDL_RESIZABLE flag when you reinitialize the screen, but I might be mistaken...


I do. I use the exact same flags when I re-initialize except for SDL_FULLSCREEN.

Quote:
Original post by Drew_Benton
As for the stall, create an empty example and see if the stall happens then. If it does, sounds like a Mac problem with the drivers or something like that. If not, then recheck your code.


I know that it is my code's fault, but I am not sure how to completely remove that stall. I initalize everything at the beginning, but that seems necessary. I was wondering if there wasn't a way to make it look more responsive, using threads, perhaps. Or if there is a way to give higher priority to a thread, that'd be good.

Quote:
Original post by the enemy
Do you get the problem with the included SDL/OpenGL example Atlantis?

I get no problems in OSX 10.4.1 using SDL and OpenGL in fullscreen mode.


The Atlantis program does not have an option switch between windowed mode and fullscreen mode, and if you're refering to the stall, no, it does not have it. Anyways, I do not think that the stall is caused by SDL, but rather by the re-initialization of the surfaces and of OpenGL.
There are alos chances that the stalls don't exist on your computer because it's more recent than mine. I have one of the old G3s, so yours is obviously faster.

Thanks for your help.

Share this post


Link to post
Share on other sites

This topic is 4586 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this