Good SDL Folk,
I am attempting to minimize a nib-less Full-Screen SDL (1.2.11) app on
Macosx (PPC 10.4.7), and not having much luck. I am either
mis-understanding exactly what minimize means to a full-screen app, or
doing something wrong, or something i haven’t imagined yet.
If I take, from the Macosx SDL devel bundle of 1.2.11, the “SDL OpenGL
Application” example and modify it in a couple of ways, I get some
puzzling results:
First, I modify the main loop of that program (starting at about line
110 of main.c of that bundle) thusly:
/* Check for events */
while ( SDL_PollEvent (&event) ) {
switch (event.type) {
case SDL_MOUSEMOTION:
break;
case SDL_MOUSEBUTTONDOWN:
done = 1;
break;
case SDL_KEYDOWN:
printf("minimize: %d\n", SDL_WM_IconifyWindow());
break;
case SDL_QUIT:
done = 1;
break;
default:
break;
}
}
Which is to say: if there’s a mouse-down, quit. If there is a
keydown, then attempt to SDL_WM_IconifyWindow, and print the return
value.
-
If I leave it not full screen (so about line 72-73 of the main.c of
that bundle, I force it to never full screen), then on a keydown, that
window minimizes, and the return value is 1. -
If I force it to full screen in the code (so add SDL_FULLSCREEN to
flags always), then I get the full-screen app. A keydown then, the
window does not minimize, but the return value is still 1 (which the
API doc leads me to think is “success”).
Am I off base here? What strategies does one use on macosx to
minimize, hide, iconfify, an SDL app?
I have tried to make a call to an obj-c function to manipulate
NSApplication (hide: and deactivate), to no avail. SDLMain has set
itself as the delegate of NSApplication, and doesn’t know “hide:”, and
deactivate didn’t seem to do anything.
Any ideas? any advice or pointers appreciated.
cheers,
Nigel