View Full Version : animation rendering...

10-06-2003, 08:47 AM
where who make rendering?
i'm using mfc, and do rendering in OnIdle, when free idle processing is avialable, but processor loads to 100% if window client area is not visible(window moved with mouse) or if it is "iconic"(in taskbar)! i already fixed problem with iconic by using m_pMainWnd->IsIconic() in OnIdle!

p.s. i saw much demos which has same problems (NeHe's and from delphi3d.net) everywhere drawing goes in idle! note that if i use SetTimer to do rendering, then there is no 100% loading!

so what to do?

10-06-2003, 12:11 PM
That's normal when you use idel processing, the idle method returns true or false depending if you need to process more, if you request more idle processing you will get 100% usage because when there are nor messages to dispatch it will call the idle handler instead and you end up with 100%.

This is of course not the case with a timer, because you set an interval, but if you try to set the interval very low (1 ms or so) then you will get the same behavior as with idle processing.