windows movement 'knocking out' my FPS

Started by
4 comments, last by darrenmarklines 18 years ago
Hi, I have a C++ engine which runs in windowed mode, the renderloop is inside of it's own high priority thread , this in turn exists inside of an MFC DLL. The engine renders and presents to a hwnd. A basic mesh with 1 light runs at around 2400 frames per second. I think you will agree this is very fast, but , and this is a big but, if I move or minimize a window, like notepad, my FPS is getting knocked to below 100 FPS. Is there any way I can prevent windows operations from impacting on my performance? The hardware is a dual processor system with a GEFORCE 7800 GT card.
Advertisement
I can't give you an solution, but IMO it's good behaviour. A nicely behaved 3D app shouldn't hog the CPU when it's not in focus.
I completely agree. I personally cannot see any way of "correcting" this behaviour beyond what you've already done -- which was super smart btw :)
Note that FPS on light scene loads just don't matter. There's too much overhead and other stuff going on in the system to worry about it. Also, FPS measurements over 100 fps start degrading in accuracy because of the jitter in scheduling and timers (even if you're using QueryPerformanceCounter, which is the best accuracy trade-off these days).

Make sure your scene can provide a reasonable load for your system -- add art until it's down to 200 fps or less, using a release mode build, using release mode drivers. Then start measuring performance behavior.

Last: if your app isn't the foreground/focus app (such as when minimizing the window or activating another window), Windows will not give you all the CPU. Sorry.
enum Bool { True, False, FileNotFound };
While you're dragging your window around, it is recieving messages, so your loop isn't being entered. Same goes for when you're resizing or minimizing the window.
Hmm,

you talk about the CPU load, the system is dual processor with hyper-threading which gives 4 effective CPU's, at no point is there any maxing out on the cpu. I can see my render loop is running in one of the 4 cpu's in task manager (around 70% usage), but the other 3 cpu's are doing nothing. I can't believe that windows messages are causing so much of a performance drop.

This topic is closed to new replies.

Advertisement