Archived

This topic is now archived and is closed to further replies.

MrShaneParker

EXTREME Performance loss with DX8...

Recommended Posts

Hey... every time i run my DirectX 8 application, all other programs running on my system suffer a really big performance loss. The DirectX application runs perfect, it doesn''t lag at all. Has anyone else had this happen to them? It''s like it''s sucking up all of my resources. Are there any ideas as to what is happening? The program can''t be too processor intensive... all it does is render two triangles onto the screen... any suggestions on how i could regain some performance? Any help would be appreciated! Thanks! -Shane

Share this post


Link to post
Share on other sites
Perhaps it has something to do with DX allocating system resources or how your window was made. If it is fullscreen or anything like that it will probably suck up performance to run the best it can.

Share this post


Link to post
Share on other sites
G''day!

Are you running on Windows 2000? Under Win2K the process owning the active window gets a big priority boost.

Is the rendering code running in a tight loop? It may be only rendering 2 triangles, but it''s doing it as fast as it can. This isn''t DX specific, any app that''s running all out will devour your CPU.

You can try putting some Sleep() statements in, or you can set up some Windows timers and wait on them.


Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
quote:
Original post by DrunkenHyena

G''day!



The advertising is false. Australians do not really say that. I know that because I am an Australian and I can not remember the last time someone said that to me.

quote:

Are you running on Windows 2000? Under Win2K the process owning the active window gets a big priority boost.



I found during testing of my application that the active application got a priority boost only when the mouse was within the bounds of the application window. I was trying to work out why my peak frame rate would drop from ~300 to ~180 at various times and then I discovered the mouse issue. So my application now positions the mouse in the centre of the application window and it never slows down any more.

Steve ''Sly'' Williams  Code Monkey  Krome Studios

Share this post


Link to post
Share on other sites
quote:
Original post by MrShaneParker

Hey... every time i run my DirectX 8 application, all other programs running on my system suffer a really big performance loss. The DirectX application runs perfect, it doesn''t lag at all. Has anyone else had this happen to them? It''s like it''s sucking up all of my resources.


Your DirectX application will be constantly redrawing the screen. This is different to other applications that are usually waiting on messages to come in from Windows. When your DirectX application is not active, it should not be constantly redrawing its display. It should stop processing and patiently wait for messages like any other well-behaved application. Process the WM_APPACTIVATE message to know when your application is made active or inactive. Set a boolean flag to true if the application is suspended (the user switched away from your application) or false (the user activated your application). In your message loop, if this boolean flag is true then call WaitMessage or GetMessage instead of PeekMessage. If this boolean flag is true, then skip the logic and draw as well.

Steve ''Sly'' Williams  Code Monkey  Krome Studios

Share this post


Link to post
Share on other sites