Page 2 of 2

Posted: Thu Mar 09, 2006 5:10 pm
by vitek
For those who haven't seen this before, you can give up some cpu time when the app is not active...

Code: Select all

while(IrrDevice->run() && IrrDriver) 
   { 
      if (IrrDevice->isWindowActive()) 
      {
      // render and all that stuff
      }
      else
      {
      Sleep(100); // give up cpu time if not active
      }
   }
If you're writing cross platform code, unix variants have usleep which is similar.

Good idea...

Posted: Thu Mar 09, 2006 6:46 pm
by r3i
great vitek!!
I've created a simple class that takes the application paused.
I've had an idea to fork the main and controlling the main loop of the child through a system message handler in order to stop o replay