Sign in to follow this  

MDX - Direct3D and Graphics object

Recommended Posts

I am working on maps visualisation software - I have decided to draw outlines and vertex rectangles using simple GDI+ and map content using Direct3D (for Performance issues). Effect is quite impressive but I have no Idea how to avoid flickering of GdI+ drawing. I am callin GDI+ render right after device.Present() method so first direct3d content shows up and then Gdi+ . I have did some improvments to avoid unnececery renderings but application must render during map operations like zoom-in zoom-out, translation and many others. So - my question is - How to avoid flickering when usinhg mixed Direct3D and GDI+ on windows forms. One solution is to get back buffer surface and draw on it Microsoft.DirectX.Direct3D.Surface backbuffer; backbuffer = device.GetBackBuffer( 0, 0, BackBufferType.Mono); (Solution from Microsoft Forums) but when I am trying to do: Graphics graphics = backbuffer.GetGraphics(); App crashes with "Error in application" message I have found solution where author said to use 2 Back Buffers- I did that - still does not work - still same problem. Changing back buffer format from A8R8G8B8 to X8R8G8B8 (to avoid lack of alpha spport for GDI problem ) allso does not help Any more Ideas?

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