Converting from Windows GDI to Irrlicht

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post 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.
r3i
Posts: 147
Joined: Wed Jun 29, 2005 10:15 am
Location: Sorrento
Contact:

Good idea...

Post 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
"We work in the dark, we do what we can, we give what we have, Our doubt is our passion and our passion is our task. The rest: is art of Madness" (H.James)
Post Reply