don't render while minimized

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4792 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2010-03-17 19:28:10 +00:00
parent a9d8ee65f9
commit b6b1f55f79
+3 -1
View File
@@ -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, fps<lowfps ? fps/lowfps : (fps>highfps ? fps/highfps : 1.0f), fps);
if(frames>4) SDL_GL_SwapBuffers();