Skip to main content
gamedev.net
🔒 Locked

CPU usage

Started by Moquan 2 replies 350+ views
Original Post
Moquan
Moquan
I''ve written a tetris clone in Direct-X and happened to look at my CPU usage. 100%! This can''t be right. What might be causing my CPU to be hogged like this. I can run movies and such outside of the program and they aren''t effected at all, so what could be causing my program to use as much as it can? Thanks
Moquan
zealouselixir
zealouselixir
Investigate the use of the Sleep(n) function.
[twitter]warrenm[/twitter]
Colin Jeanne
Colin Jeanne
It''s probably your message loop. I would imagine that it is using PeekMessage()?

Further: your program uses as much CPU as it can, so what? Unless you want to cap the frame rate (see previous post) dont worry about it.


Colin Jeanne | Invader''s Realm
VolkerG
VolkerG
Why bother? Almost every game has a CPU usage of 100%. It has to do with the way they handle the messages (a game usually is not halted waiting for them).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.