I've been working on this for a couple days now. I'm really looking for the best way to render. Nothing too complicated but something that is fast, reliable, and powerful. I've seen many websites and about each one shows a different way. I've probably gone through about 5 different ways so far. But I'm really looking for a good, reliable one and I don't think I have found it yet.

I'm looking for a way that if the game is minimized, then no rendering will take place. Such that, the CPU usage is less than 5%. Also, a lot of people say handle the message to check when the game is minimized and then sleep every 50 ms until the game is back up. That just seems so messy to me. I'm looking for a way that will not Render or anything like that when the program is minimized, but when it is maximized, the device will reset.

I'm looking for a way that will process messages very fast (i suppose with peekmessage combined with a while loop) and a way that will allow the program to exit once the message is WM_QUIT. Perhaps the outer loop being a while loop checking peekmessage for WM_QUIT? I'm just not sure. I guess I'm just looking for a perfect loop. I know there probably isn't one, but there has to be at least some good ones.

Most of the examples I find on the web, the CPU usage is 50% when the game is minimized, the device doesn't properly get reset when the program is maximized again, etc etc.

I fiqure I should use TestCooperativeLevel() but whatever I try always never works (processing while game is minimized, device not getting reset properly, etc.)

Really, I'm just looking for idea on creating a GOOD render loop. One suitable for a large game. Thanks for any help :)

9 Years
Discussion Span
Last Post by FireNet

Dont have any code atm .... But you could look to catch the window's minimize message and skip your render & update parts of your game. Then catch the restore message, reset/reload any resources you need (images, timmer, models ect).

... that's how I used to do it. I use OpenGL now .... really clean & simple code and no resource losses....

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.