Archived

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

Nytegard

Choppiness

Recommended Posts

Using DX8. This is happening with D3D. Whenever the window is completely covered, my system slows down tremendously. My mouse starts jumping everywhere, etc. However, if even a pixel of my window is showing, everything goes back to being smooth, even if the window isn''t focused. Could someone explain why this is happening?

Share this post


Link to post
Share on other sites
If your window has lost focus:

- you shouldn''t update your main loop of your program,

- you also should drop back to a more system friendly message pump (i.e. if you''re using PeekMessage with PM_NOREMOVE, when you don''t have focus you should be using a WaitMessage() to yield unused time from your process).

- finally you should only render in response to messages such as WM_PAINT which ensures you aren''t asking the system to draw one desktop (with your app on), and redraw the whole thing with display from another app. (You might want to play with returning 1 from WM_ERASEBCKGND).

- If your window gets resized (even by the other app being drawn on top) and you care about having that functionality you should recreate the swap chain for the new size of the window. In windowed mode if the D3D device window is stretched, it appears to use some sort of super-slow stretch blit (check if you are recieving any size messages in response to being covered).

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
quote:
Original post by S1CA
- If your window gets resized (even by the other app being drawn on top) and you care about having that functionality you should recreate the swap chain for the new size of the window. In windowed mode if the D3D device window is stretched, it appears to use some sort of super-slow stretch blit (check if you are recieving any size messages in response to being covered).


Being (partly) covered doesn''t count as a resize event. No WM_SIZE message will be sent unless the window actually changes in size. Partly covered windows, are implemented by clipping everything that is drawn to the visible region of the window.

Share this post


Link to post
Share on other sites