Jump to content
  • Advertisement
Sign in to follow this  
eelke_folmer

[SDL] Fullscreen mode not working on mac

This topic is 4037 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

I'm trying to get my game running in Fullscreen
screen = SDL_SetVideoMode(X_SIZE, Y_SIZE, BPP, SDL_OPENGL| SDL_FULLSCREEN);
For some reason I have to use SDL_OPENGL to setup the window (leaving it out makes the game crash on my mac). I'm having problems with the fullscreen mode. It starts in fullscreen i see the mouse pointer, then I see some strange stripes moving horizontally across the screen, which reminds me of the old dos days when you selected a wrong video mode. Before i exit the game using a keypress the menu of my game briefly shows up). Does anyone have any suggestions on what to do or is this just a mac only problem? Do SDL_OPENGL and SDL_FULLSCREEN conflict? I can't set a window up without using SDL_OPENGL all of the SDL tutorials that I found on my mac use SDL_OPENGL too.

Share this post


Link to post
Share on other sites
Advertisement
I am having no problem running fullscreen GL; perhaps you should ask the SDL mailing list.

Share this post


Link to post
Share on other sites
try creating a fullscreen window with the same resolution as the native resolution of your screen. Im running 10.4.9 and sdl and opengl work fine. What hardware are you running?

Share this post


Link to post
Share on other sites
The "strange stripes" might also be framebuffer garbage; SDL tends to display those in a window before you've updated the display properly.

I think SDL_OPENGL requires a different method of updating the display than SDL_Flip. Again, the mailing list should know this.

Share this post


Link to post
Share on other sites
I use SDL_GL_SwapBuffers() in my apps. Also, you cant use the DOUBLE_BUFF flag in your SDL initialization, you should use SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); instead, which some older examples dont do.

Share this post


Link to post
Share on other sites
I am running my game on my macbook pro (intel cpu 2.16 ghz).

I tried everything that has been suggested even in my native resolution 1440x900 still get the stripes.


//************************
//Screen Init
//************************
SDL_Surface *screen;
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16);
Uint32 flags = SDL_OPENGL | SDL_FULLSCREEN;
screen = SDL_SetVideoMode(X_SIZE, Y_SIZE, BPP, flags);
if (screen == NULL) {
printf("Unable to set video mode: %s\n", SDL_GetError());
return 1;
}

Share this post


Link to post
Share on other sites
Also, are you making sure to clear the colour and depth buffer? Sometimes the ATI driver likes to leave garbage behind when it creates a new window. glClear should take care of it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!