• Advertisement

Archived

This topic is now archived and is closed to further replies.

Problem 100% Proccess

This topic is 5661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, working Visual C++ and DirectX8, but use 100% resources machine. PIII 800MHz, Video ATI, 256M RAM.

Share this post


Link to post
Share on other sites
Advertisement
main loop seems too tight, try adding a sleep or wait into the loop, i think windows has uSleep()

Share this post


Link to post
Share on other sites
There''s nothing wrong with using 100% of resources. It doesn''t necessarily affect other programs (since Windows4.x+ will pull the carpet out from under you, unlike Windows 3.x which required you to release the processor).

The only case where you have a problem is if you use an inordinate amount of memory or your app doesn''t die properly (continues to use resources after exiting).

Share this post


Link to post
Share on other sites
I have a question that using 100% is fine when that window has focus but if i open a nother app and the Directx app goes to the background my Comp slows to a crawl... how can i Avoid this?

Share this post


Link to post
Share on other sites
Create a gobal variable that you can test against in your gameloop .... i.e.


void GameLoop()
{
if( !g_bActive )
return;

// Other code etc.....

}


Change the g_bActive when your program gains focus and looses it to the appropreate value.


Just a suggestion No doubt there are better solutions out there but this works for my needs.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Use GetMessage() when you are inactive.
Use PeekMessage() when you are active.

Share this post


Link to post
Share on other sites

  • Advertisement