This is my environment:
Windows 98
SDL 1.2.5
GeForce4 MX440
This is taken from my own version of Sam Lantinga’s SDL hack of NeHe’s
OpenGL tutorial
(so I’m in a SDL_OPENGL rendering context):
active=1;
done=0;
while (!done)
{
SDL_Event event;
if (active)
DrawGLScene(); //rendering function
while (SDL_PollEvent(&event))
switch (event.type)
{
case SDL_QUIT:
done = 1;
break;
case SDL_KEYDOWN:
if (event.key.keysym.sym == SDLK_ESCAPE)
done = 1;
break;
case SDL_ACTIVEEVENT:
if (event.active.state == SDL_APPACTIVE) {
active = event.active.gain;
fprintf(stderr,"active=%d\n",active);
}
break;
default:
break;
}
}
When I iconify/restore the window, SDL_APPACTIVE is never triggered. Why?