From 56af82b1c972129aefc00599714db0cceeaf91ce Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 14 Jun 2004 03:12:32 +0000 Subject: [PATCH] HandleSDLEvents --- stepmania/src/RageDisplay_D3D.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/stepmania/src/RageDisplay_D3D.cpp b/stepmania/src/RageDisplay_D3D.cpp index a60d9385e2..2f6cd75d05 100644 --- a/stepmania/src/RageDisplay_D3D.cpp +++ b/stepmania/src/RageDisplay_D3D.cpp @@ -321,9 +321,11 @@ RageDisplay_D3D::RageDisplay_D3D( VideoModeParams p ) void RageDisplay_D3D::Update(float fDeltaTime) { + HandleSDLEvents(); + #if defined _WINDOWS SDL_Event event; - while(SDL_GetEvent(event, SDL_VIDEORESIZEMASK)) + while(SDL_GetEvent(event, SDL_VIDEORESIZEMASK|SDL_ACTIVEEVENTMASK)) { switch(event.type) { @@ -334,6 +336,16 @@ void RageDisplay_D3D::Update(float fDeltaTime) /* Let DISPLAY know that our resolution has changed. */ ResolutionChanged(); break; + case SDL_ACTIVEEVENT: + { + /* We don't care about mouse focus. */ + if(event.active.state == SDL_APPMOUSEFOCUS) + break; + + uint8_t i = SDL_GetAppState(); + FocusChanged( i&SDL_APPINPUTFOCUS && i&SDL_APPACTIVE ); + } + break; } } #endif