Skip to content

Commit

Permalink
* Added code to sleep a bit when q3 has no focus and sleep a lot when…
Browse files Browse the repository at this point in the history
… it's

  minimised (SDL only)
  • Loading branch information
timangus committed Jan 23, 2006
1 parent 704c151 commit 5a29e8d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions code/unix/unix_main.c
Expand Up @@ -1400,6 +1400,18 @@ int main ( int argc, char* argv[] )

while (1)
{
#if !defined( DEDICATED ) && USE_SDL_VIDEO
int appState = SDL_GetAppState( );

// If we have no input focus at all, sleep a bit
if( !( appState & ( SDL_APPMOUSEFOCUS | SDL_APPINPUTFOCUS ) ) )
usleep( 16000 );

// If we're minimised, sleep a bit more
if( !( appState & SDL_APPACTIVE ) )
usleep( 32000 );
#endif

#ifdef __linux__
Sys_ConfigureFPU();
#endif
Expand Down

0 comments on commit 5a29e8d

Please sign in to comment.