[gameprogrammer] Re: game taking up a lot of cpu when minimized

Dear Alan,

Check your message loop. It might not be the normal loop that is there in
Win32 project.

Regards
Biswanath Das


On Sun, Apr 26, 2009 at 8:51 AM, Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote:

> ok so i think this is a fairly common problem, cause i hit it before when
> working on a project with some other people but i dont remember how it was
> solved....
>
> im makin a game on the windows platform in directx, and when my game window
> is obscured or it's minimized, etc, it eats up a ton of cpu.
>
> i'm guessing it's because vsync isn't there to slow it down (since nothing
> is being rendered) but im not sure.
>
> When a d3d error of D3DERR_DEVICELOST is returned, i have it sleep for
> 500ms before going to the next game loop.  I thought that was the fix for
> this problem but im finding that i am NEVER getting the device lost error
> when minimizing or the window is obscured.
>
> anyone know how to handle this issue?
>
> Thanks!
> Alan
>

Other related posts: