How do i detect window lost focus and gained focus back using SDL?

How do i detect window lost focus and gained focus back using SDL?

Thanks…

JeZ+Lee
of
Silent Hero Productions®

Hello !

How do i detect window lost focus and gained focus back using SDL?

The needed information is in the Wiki :

http://www.libsdl.org/cgi/docwiki.cgi/SDL_ActiveEvent

http://www.libsdl.org/cgi/docwiki.cgi/SDL_GetAppState

CU

Hi,

Did this, and it is not working:--------------------------------------------------------------------
Uint8 gameState = SDL_GetAppState();
if (gameState && SDL_APPINPUTFOCUS)
{

}

What am i doing wrong?

JeZ+Lee
of
Silent Hero Productions®

Torsten Giebl wrote:

Hello !

How do i detect window lost focus and gained focus back using SDL?

The needed information is in the Wiki :

http://www.libsdl.org/cgi/docwiki.cgi/SDL_ActiveEvent

http://www.libsdl.org/cgi/docwiki.cgi/SDL_GetAppState

CU


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hi,

Did this, and it is not working:

Uint8 gameState = SDL_GetAppState();
if (gameState && SDL_APPINPUTFOCUS)
{

}

What am i doing wrong?

JeZ+Lee
of
Silent Hero Productions®

Using && instead of & for a bitwise operation.— On Wed, 8/13/08, Jesse P. wrote:

From: Jesse P.
Subject: Re: [SDL] How do i detect window lost focus and gained focus back using SDL?
To: “A list for developers using the SDL library. (includes SDL-announce)”
Date: Wednesday, August 13, 2008, 4:08 PM