Game Development Community

iTorque2Dgame.exe high CPU Usage

by Craig Jorgensen · in iTorque 2D · 09/01/2011 (4:51 am) · 3 replies

Hi all,

Ive noticed something rather strange with iTorque2d projects. It seems that when running the game and the game window has focus, the CPU usage jumps right up (one core going almost 100%) however when i click elsewhere so the window doesn't have focus (but is still visible), it drops down to 0. You can see this even if you create a brand new project with pretty much nothing on it, i just put a bitmap on the screen for my test. I have also tried with a project that has constant movement and screen updates, high cpu usage when the window has focus, no cpu usage when it doesnt have focus (even though i can see its still rendering the scene and scrolling around the scene). Ive tested this with it2d prev1 and prev2 (same result on both). Im running on a win7 x86 machine, dual core 3ghz. Im also running the app on my windows pc, havent checked cpu usage when run on an apple device.

Has anyone else come across this?

Regards
Craig

#1
09/01/2011 (5:26 am)
That's not strange. That means the engine is actually going into resting mode when you deactivate it. If it continued to use the CPU (use all cycles available for rendering the scene) while inactive you'd have something to complain about ;)
#2
09/01/2011 (5:42 am)
fair point, was not considering the fact that it would be better to render at maximum frame rate when having focus and drop to a minimal frame rate when not in focus. I just put the debug banner on and can see it going from about 800 fps when in focus to about 40 when not. At the time i was just looking at the end result which visually appears to be rendering the animation the same at 0 or 100% cpu.
#3
09/01/2011 (7:13 am)
The Mac editor runs at much less CPU, so it's down to optimisation. But the TGB editor runs at full tilt on any OS, and even while inactive on OS X. Backported optimisations are coming eventually, they said :)