Sign in to follow this  
Montynis

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

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this