[SDL] Mac OS X fullscreen and fades

Christian Walther cwalther at gmx.ch
Wed Feb 1 03:43:48 PST 2006


Nice work! From reading the code, it seems OK, and as far as I have 
tested, it works with my application. I do have a few pieces of 
criticism, though:

- Please attach patches instead of pasting them. Mail programs tend to 
mangle them (remove spaces at the end of lines, insert line breaks, ...).

> OK, I removed a few of the fades...

- A few of them? As far as I can see, you removed *all* of them! I don't 
like that.

However, apparently the OS does some fading on its own: fade to black 
before switching from fullscreen to a different resolution, and fade 
from black after switching to fullscreen from a different resolution. 
It's much faster than the SDL fades (which is nice), but it's not 
sufficient.

Give me some time and I'll try to identify all the cases that need to be 
handled and work out what I propose to do.

Two problems I see at the moment:

* In the current SDL (without your patch): I'd get rid (at least) of the 
fade-from-black after switching to a fullscreen mode. I'm not sure about 
2D, but with OpenGL it just fades from black to black because at that 
time there hasn't been a chance to render anything yet (can some 2D user 
comment on that?). We should be able to let the OS fade handle this - it 
runs asynchronously while the game is already rendering (which is the 
proper thing to do, IMHO).

* With your patch: When switching from fullscreen, I get garbage on the 
screen before the OS fade kicks in (this is with OpenGL). It looks like 
the previous frame buffer interpreted with an incorrect pitch. We should 
have SDL fade to black to hide that.

- There's a leftover comment on line 523.

- The contents of the "if (to_desktop) {...}" (lines 473 - 482) should 
be indented.

> ... and it seems to work fine with no flickering.

Not flickering per se, but I do see some garbage (see above).

  -Christian




More information about the SDL mailing list