Any gotcha's with fullscreen SDL on OSX?

hi,

are there any known issues with running an SDL 1.2.7 app in full
screen under OSX (10.3.4)?

I do this:

// … from Video_Init:
int video_flags = SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN;
int width = 480, height = 320, depth = 32;

// SDL
if (SDL_Init (SDL_INIT_VIDEO) < 0) //| SDL_INIT_EVENTTHREAD) < 0)
return 1;

if ((the_screen =
SDL_SetVideoMode (width, height, depth, video_flags)) == NULL)
{
SDL_Quit ();
return 1;
}
// …

Without “SDL_FULLSCREEN” I get a window’ed SDL app, and things run
just fine. With it, I get a full-screen modeswitch, and then a
totally blank screen (none of my graphics) until I force-quit the app
somehow…

Are there any known gotcha’s with full-screen display mode under OSX
in SDL? I installed SDL 1.2.7 using ‘fink’ … maybe I need to try
some other install?–

;

Jay Vaughan

Are you using SDL_Flip() to update the screen instead of
SDL_UpdateRect()?

— Jay Vaughan wrote:> hi,

are there any known issues with running an SDL 1.2.7 app in
full
screen under OSX (10.3.4)?

I do this:

// … from Video_Init:
int video_flags = SDL_HWSURFACE | SDL_DOUBLEBUF |
SDL_FULLSCREEN;
int width = 480, height = 320, depth = 32;

// SDL
if (SDL_Init (SDL_INIT_VIDEO) < 0) //|
SDL_INIT_EVENTTHREAD) < 0)
return 1;

if ((the_screen =
SDL_SetVideoMode (width, height, depth, video_flags))
== NULL)
{
SDL_Quit ();
return 1;
}
// …

Without “SDL_FULLSCREEN” I get a window’ed SDL app, and things
run
just fine. With it, I get a full-screen modeswitch, and then
a
totally blank screen (none of my graphics) until I force-quit
the app
somehow…

Are there any known gotcha’s with full-screen display mode
under OSX
in SDL? I installed SDL 1.2.7 using ‘fink’ … maybe I need
to try
some other install?

;

Jay Vaughan


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail

hi,

are there any known issues with running an SDL 1.2.7 app in full
screen under OSX (10.3.4)?

I do this:

// … from Video_Init:
int video_flags = SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN;
int width = 480, height = 320, depth = 32;

…um, I don’t know if 320x480 is a valid fullscreen display dimension:
try 640x480…also remember you don’t need double buffering in OSX;
the window manager does that for you! Other than that, I’d look at the
error messages that are produced, they often provide vital clues :wink:

l8r,
jamieOn Jul 16, 2004, at 5:30 AM, Jay Vaughan wrote:

hi,

are there any known issues with running an SDL 1.2.7 app in full
screen under OSX (10.3.4)?

I do this:

// … from Video_Init:
int video_flags = SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN;
int width = 480, height = 320, depth = 32;

This is kind of irrelevant, but, I might as well put it out there.
Every tutorial on the internet uses code like this. They put together
the video flags and store it in a variable. But they never use this
information afterwards, and my guess is that you aren’t either. You
don’t NEED to store your video flags in a variable before calling
SDL_SetDisplayMode().

…um, I don’t know if 320x480 is a valid fullscreen display
dimension: try 640x480

Closer would be 480 x 360, that is the lowest most VGA monitors support.

…also remember you don’t need double buffering in OSX; the window
manager does that for you!

  1. I doubt Jay is only developing his application for only OS X,
    otherwise, why use SDL at all… if you want double buffering, ASK FOR
    DOUBLE BUFFERING. This was BAD advice.

  2. The Window Composition Layer (Quartz Extreme) is responsible for
    window drawing. This is not the responsibility of the window manager
    (though they obviously work closely together, they are not the same
    component.)

  3. OSX will not ALWAYS buffer your application’s display the way you’re
    suggesting. Yes it’s true, that the window composition layer (not the
    window manager) does create the image of your window off-screen and in
    that sense there is a second display buffer, but without actually
    requesting double buffering, there are two possible behaviors for the
    window composition layer:

a) composition that is asynchronous with your application
b) you get real hardware access to the portion of the screen occupied
by your window, no buffering at all

In Jaguar I’ve been told you get B. I use panther, and I get A.

Other than that, I’d look at the error messages that are produced,
they often provide vital clues :wink:

Jay, did you get any error messages? You should check for that kind of
early on, so I assume that you didn’t get any, since you didn’t mention
any in your email.

l8r,
jamie


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Jay, I’ve never had any problem, I was going to suggest you do one of
the following, but decided to postpone my suggestion until other people
had a chance to say something, in case there actually were any
"gotchas."

  1. Post all your source code, you may have a fairly coding mistake that
    will be found quickly by an objective reader.

  2. Test your code on another OS, perhaps it’s not an OS X problem at
    all.

  3. Test an application that does what YOU are trying to do, and see if
    it has a problem on your system. If it doesn’t, again, you may have
    made a simple mistake in your code.On Jul 16, 2004, at 12:42 PM, James Tittle II wrote:

On Jul 16, 2004, at 5:30 AM, Jay Vaughan wrote:

Jay Vaughan wrote:

hi,

are there any known issues with running an SDL 1.2.7 app in full
screen under OSX (10.3.4)?

I do this:

// … from Video_Init:
int video_flags = SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN;
int width = 480, height = 320, depth = 32;

// SDL
if (SDL_Init (SDL_INIT_VIDEO) < 0) //| SDL_INIT_EVENTTHREAD) < 0)
return 1;

if ((the_screen =
SDL_SetVideoMode (width, height, depth, video_flags)) == NULL)
{
SDL_Quit ();
return 1;
}
// …

Without “SDL_FULLSCREEN” I get a window’ed SDL app, and things run
just fine. With it, I get a full-screen modeswitch, and then a
totally blank screen (none of my graphics) until I force-quit the app
somehow…

Are there any known gotcha’s with full-screen display mode under OSX
in SDL? I installed SDL 1.2.7 using ‘fink’ … maybe I need to try
some other install?

That can be a symptom that your code is wrong. For example if you don’t
call SDL_UpdateRects/SDL_Flip, or if you assume no surface locking is
needed or…
Well, if we don’t see the code, we can’t really say.

Stephane

hi,

are there any known issues with running an SDL 1.2.7 app in full
screen under OSX (10.3.4)?

None are known to me, at least with SDL CVS. If you can provide a
minimal example application (C code) I can try to look into your issue.
However, please note that e.g. ScummVM uses the SDL fullscreen mode on
OSX w/o problems; and despite what some people here said, requesting a
320x240 full screen resolution is no problem either; in the worst case
the system will emulate unsupported resolutions by setting a higher res
and then only using a portion of that.

Cheers,

MaxAm 16.07.2004 um 11:30 schrieb Jay Vaughan: