Switching modes and drawing trails

Started by
2 comments, last by Headkaze 17 years, 1 month ago
Can someone please show a basic template for dealing with switching between fullscreen and windowed mode in MDX1/C#/DirectX 9. Also I'm using Tom Miller's famous render loop (http://blogs.msdn.com/tmiller/archive/2005/05/05/415008.aspx) but when I move the window around it leaves behind what has been drawn. I can also seem to access windows "through" it; the graphics of the windows behind it flicker through and I can even click on buttons from applications behind my DX application. Any ideas what might be causing this?
Advertisement
Have you tried resetting the device with the adjusted presentparemeters when the window has been resized? Moving should typically not require a reset, but if this problem occurs while moving after you switched back from fullscreen, something might be wrong with the viewport... Either way, manually calling Reset on the device would be worth a shot.
Rim van Wersch [ MDXInfo ] [ XNAInfo ] [ YouTube ] - Do yourself a favor and bookmark this excellent free online D3D/shader book!
For handling the movement issue, you should be able to call your Draw call from the Moving event on the forum. The event should fire enough to allow you to keep the window partially up to date, and not looking horrible.

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.
Thanks guys, I have the windowed/fullscreen switching working now.

I'm still having problems when in windowed mode that the rendered graphics are left when the window is moved. And that anything underneath the window can be accessed with the mouse like the window is not even there.

I'm not quite sure what you mean by "you should be able to call your Draw call from the Moving event on the forum" sirob. I have tried the following but no change:

private void MainForm_Move(object sender, EventArgs e){   this.Invalidate();   this.Refresh();}

This topic is closed to new replies.

Advertisement