From b6b1f55f792ec98765722a5e9121391ad8235638 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Wed, 17 Mar 2010 19:28:10 +0000 Subject: [PATCH] don't render while minimized git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4792 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/src/main.cpp b/source/src/main.cpp index 999e81ac..fd0b826d 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -644,6 +644,8 @@ void checkinput() case SDL_ACTIVEEVENT: if(event.active.state & SDL_APPINPUTFOCUS) inputgrab(grabinput = event.active.gain!=0); + if(event.active.state & SDL_APPACTIVE) + minimized = !event.active.gain; #if 0 if(event.active.state==SDL_APPMOUSEFOCUS) setprocesspriority(event.active.gain > 0); // switch priority on focus change #endif @@ -926,7 +928,7 @@ int main(int argc, char **argv) audiomgr.updateaudio(); computeraytable(camera1->o.x, camera1->o.y, dynfov()); - if(frames>3) + if(frames>3 && !minimized) { gl_drawframe(screen->w, screen->h, fpshighfps ? fps/highfps : 1.0f), fps); if(frames>4) SDL_GL_SwapBuffers();