Jump to content
  • Advertisement

Archived

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

Ryanrk

Limiting Program Resources

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

I just created a single play Directx windowed tetris using clone game. All it uses is 2d sprites in Direct3d. One problem i don''t like with it is it takes 99 - 100% of my cpu and I don''t think it needs too. It runs fine on any cpu speed from 400mhz and above (haven''t tested it below 400mhz) and i''m running a 1.2ghz athlon so it should need it all. How can i restrict it from taking all my cpu time. Thanks! Ryan

Share this post


Link to post
Share on other sites
Advertisement
Sleep(10) called once per loop, it works well with the gdi, not sure about direct x

--Fireking

Owner/Leader
Genetics 3rd Dimension Development

Share this post


Link to post
Share on other sites
Well, using 99% CPU time isn''t a bad thing. If you''ve written a tight main loop, it will eat it up if it''s available. It''s only 99% because probably not many other CPU intesive programs are running. If you run other applications they shouldn''t be sluggish. If they are then your probably not processing messages fast enough.

Share this post


Link to post
Share on other sites
Yea the other programs do seem sluggish. I might play around with the sleep command and see how that works.

(UPDATE) Sleep(10) seems to work perfect, now it only uses like 1-2% of my cpu and runs great. Thanks Guys/Gals

[edited by - Ryanrk on September 15, 2002 1:58:36 PM]

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!