[.net] DirectX painted graphics disappear (not solved yet)

Started by
1 comment, last by Montynis 16 years, 11 months ago
Hello, I have created a simple form. DirectX paints its graphics on it. In the constructor of the form, I set: this.Setstyle(Controlstyles.UserPaint, true); this.Setstyle(Controlstyles.AllPaintingInWmPaint, true); (I want to avoid flicker when a dialog control (like SaveFileDialog) is moving). Everything works fine until I call a standart dialog control. Then all DirectX painted graphics disappear, and I see a gray background of my form. Are there any solutions for this problem (I want at the save time reduce flicker and avoid disappearing of graphics) ? [Edited by - Montynis on May 11, 2007 9:06:28 AM]
Advertisement
What does your render loop look like?
Render loop looks like this:

public void Render()
{

SetDeviceCamera(); // lines for updating camera position
Update();

_device.BeginScene();
_device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.Black, 1.0f, 0);
_scene.Render(_camera, _device);

//rendering method in scene class where
//all DirectX graphics (like meshes and skybox) are rendered.


_device.EndScene();
_device.Present();
}

Render loop starts in a main procedure:

while (frm.Created)
{
frm.Render(); // frm - tha main form of application.
Application.DoEvents(); // DirectX paints on it.
}

This topic is closed to new replies.

Advertisement