X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FOpenGL_Windows.cpp;h=618ef4742d4218bfbb9ff5571775816b46fd8c7b;hb=4155ca2c4aa4bac78ce35a38b5e2e69c0c77e585;hp=b68c60bcfd37bc3d4e03960d401d03430aa5ddea;hpb=346d9e2d119ea3fa236905d5db018479f54c225f;p=lugaru.git diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index b68c60b..618ef47 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -1117,7 +1117,12 @@ int main(int argc, char **argv) } // game is not in focus, give CPU time to other apps by waiting for messages instead of 'peeking' - STUBBED("give up CPU but sniff the event queue"); + SDL_ActiveEvent evt; + SDL_WaitEvent((SDL_Event*)&evt); + if (evt.type == SDL_ACTIVEEVENT && evt.gain == 1) + gameFocused = true; + else if (evt.type == SDL_QUIT) + gDone = true; } }