• Advertisement
Sign in to follow this  

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

This topic is 3940 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
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.
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement