   Why simple D3D app consume 100% CPU?
  Main loop code as following:if(xGetMainWnd()->IsActive() || !(xGetApp()->GetAppstyles() & xApp::APPS_PAUSEONLOST)) bRet=(PeekMessage(&msg,NULL,0U,0U,PM_REMOVE)!=0);else bRet=(GetMessage(&msg,NULL,0U,0U)!=0);if(bRet){ TranslateMessage(&msg; DispatchMessage(&msg; xGetApp()->RenderProcedure();}The Render proceudre only clear back buffer to black color and draws nothing.How to reduce it?Any indication is appreciate,thanks in advance!   
  Well, it's just running as fast as possible, it's not actually a CPU-intensive program or anything, if that's what you're worried about.Try putting Sleep( 17 ); in there at the bottom if to bothers you enough.   ;  This question comes up fairly often, a quick search would have helped you. :)First search result. Daniel   ;  If you are the only person on a bus, the bus is devoting 100% of its resources to transport you to where you want to go.   ;  I don't understand why so many people worry about this; it's not like you're stealing time from other applications. If an application needs a resource, it's the OS responsibility to provide it. You can use Sleep() if you want to be extra nice to other apps, but then again who expects a 3D graphics program, of all applications, to be "nice"?   ;Quote:Original post by mikemanI don't understand why so many people worry about this; it's not like you're stealing time from other applications. If an application needs a resource, it's the OS responsibility to provide it. You can use Sleep() if you want to be extra nice to other apps, but then again who expects a 3D graphics program, of all applications, to be "nice"?Well, its pretty annoying when a 2D game (even a basic 3D game) is chewing through my laptop battery and burning a hole through my pants... Of course, no one expects  Doom 3 to give of "extra" resources, since it needs them, but 3D pong doesn't need that much cpu time.   ;  Thanks everybody.My current solution is to limit the 1000+ FPS to 60 to give time back to OS.Now I use (1000/CurFPS)*(CurFPS-60) to calculate the time should "relax" during one frame in ms,as RenderEverything(); Sleep( (1000/CurFPS)*(CurFPS-60) );But it seems not so accurate,is there any good ways to achieve this?Thanks again.   ;  The other way is to force VSYNC, so there is a pause after you've done all your logic and rendering while you wait for the monitor to refresh.Does VSYNC work on laptops and LCDs?   ;Quote:Original post by BoderThe other way is to force VSYNC, so there is a pause after you've done all your logic and rendering while you wait for the monitor to refresh.Does VSYNC work on laptops and LCDs?Yep. And it definitely cuts down on the medical bills for burned thighs.;  The problem with vsync is that the refresh rate may be different on different video cards. My LCD is synced to 60 Hz, but my CRT can run over 100 on lower resolutions. Keep that in mind if you plan to base all the frame timing assuming 60 FPS.   