X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;ds=sidebyside;f=Source%2FOpenGL_Windows.cpp;h=618ef4742d4218bfbb9ff5571775816b46fd8c7b;hb=decb00e82a2e65e25dbcdd8f16fff5a6a07d31d6;hp=5759ddc15fa40d270e876cca271091b7f05df98f;hpb=5c4dee6a92fa23796ada28e5e42dee7721230d3e;p=lugaru.git diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index 5759ddc..618ef47 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -572,7 +572,6 @@ Boolean SetUp (Game & game) fprintf(stderr, "Failed to load config, creating default\n"); SaveSettings(game); } - if(kBitsPerPixel!=32&&kBitsPerPixel!=16){ kBitsPerPixel=16; } @@ -1118,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; } }