It's RageDisplay::EndFrame()'s job to give up CPU between frames. Currently,

we're doing this partially in EndFrame (in FrameLimitBeforeVsync and/or the
actual vblank wait), and partially in RunGameLoop.  These serve the same
purpose, so merge them.

(The renderer itself should have more control over this, but this is an
improvement.)
This commit is contained in:
Glenn Maynard
2006-04-05 05:36:04 +00:00
parent fea9792fd6
commit 185d3d902d
2 changed files with 25 additions and 26 deletions
-11
View File
@@ -179,17 +179,6 @@ void GameLoop::RunGameLoop()
* Render
*/
SCREENMAN->Draw();
/* If we don't have focus, give up lots of CPU. */
// XXX: do this in DISPLAY EndFrame?
if( !HOOKS->AppHasFocus() )
usleep( 10000 );// give some time to other processes and threads
#if defined(_WINDOWS)
/* In Windows, we want to give up some CPU for other threads. Most OS's do
* this more intelligently. */
else
usleep( 1000 ); // give some time to other processes and threads
#endif
}
if( ChangeAppPri() )