Jump to content
  • Advertisement
Sign in to follow this  
Montynis

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

This topic is 4091 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!