Jump to content
  • Advertisement

Archived

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

carlosib

Problem 100% Proccess

This topic is 5779 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

Advertisement
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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!