[SDL] The "proper" way to detect an app context switch

Sam Lantinga slouken at devolution.com
Tue Sep 10 11:29:01 PDT 2002

> This seems like throwing a rock through a window to see if a light comes
> on rather than knocking at the front door. ;-) Is it guaranteed that I'll
> get some sort of message (like SDL_ACTIVEEVENT) when my app is about to be
> switched away (or back to), or do I need to check both the blitting result
> code *AND* look for an ACTIVEEVENT message? Of course I want to remain as
> compatible as possible across platforms.

Use SDL_ACTIVEEVENT, you are guaranteed to get it when your application loses
focus (and if you don't, it's a bug) :)

See ya!
	-Sam Lantinga, Software Engineer, Blizzard Entertainment

More information about the SDL mailing list