I wrote:
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.
OK, here we go. We basically have a state machine with 3 states:
windowed (w), fullscreen (f), and no video mode set (where we start and
return to before quitting) (n). Only the transitions to and from f are
interesting because the others don’t involve fading.
How things work in current SDL, without Gregory’s patch - in brackets
the issues we’d like to improve:
f->w:
fade to black, fade to desktop synchronously [window is not visible
during fade in, but appears afterwards]
f->f:
fade to black, fade to desktop, fade to black, fade in synchronously
[1. too many fades, 2. fading in synchronously means fading from black
to black, with the game content abruptly appearing afterwards]
f->n:
fade to black, fade to desktop
w->f:
n->f:
fade to black, fade in synchronously [i.e. from black to black, see
above]
[in general, the fades are too slow]
How things work with Gregory’s patch, according to my obervations (on
10.3.9, with OpenGL):
f->w:
fade to black, abrupt transition to desktop, window appears [garbage
is displayed while fading out (at least here, with OpenGL)]
f->f:
fade to black, fade in asynchronously [garbage]
f->n:
fade to black, abruptly to desktop [garbage]
w->f:
abruptly to black, fade in asynchronously
n->f:
abruptly to black, abruptly to game
[it may be a matter of personal preference, but I don’t like the abrupt
transitions]
How I think things should work:
f->w:
f->f:
f->n:
fade to black (to hide garbage), fade in (easier on the eyes)
asynchronously (so that actual game content fades in)
w->f:
n->f:
I’d recommend the same thing as above for the "easier on the eyes"
reason, but as there’s no garbage to hide, no fading could work too
(although it might flicker).
Fading to black should take 0.3 seconds, fading from black 0.5 seconds
(these are Apple’s default values, see the documentation cited below).
Any opinions on this? If people agree, and Gregory doesn’t beat me to
it, I can have a go at implementing it. We might throw out the
QZ_FadeGamma{In|Out}() functions entirely and use Apple’s Quartz fading
API instead (unless the observed garbage turns out to be caused by the
Quartz fading, which would mean we’d have to stick with the SDL fading).
It’s available since 10.2, and it can do asynchronous fading
(http://developer.apple.com/documentation/GraphicsImaging/Reference/Quartz_Services_Ref/Reference/reference.html).
-Christian