Sign in to follow this  

[.net] custom control flicker--using Direct3D

This topic is 3743 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

I have a custom control written in C++/CLI, and I'm using Direct3D for rendering an object in the control. The user can click on the control and move the mouse to rotate the object. This is working, but I am getting a very bad flickering. I tried setting various styles in the control constructor: this->Setstyle(static_cast<Controlstyles>( /*Controlstyles::OptimizedDoubleBuffer | */ /*Controlstyles::UserPaint |*/ Controlstyles::AllPaintingInWmPaint | Controlstyles::ResizeRedraw | Controlstyles::Selectable), true ); this->Updatestyles(); If I uncomment the double buffering styles and user paint, I don't get any output--like my paint handler doesn't get called at all. Even with AllPaintingInWmPaint I still get flicker. In my mouse move handler, if the left mouse button is down, I call Invalidate to redraw. I do my drawing in OnPaint: void D3DControl::OnPaint(PaintEventArgs^ e) { if( device) { device->Clear(0, 0, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, 0x00000000, 1.0f, 0); device->BeginScene(); ... Anyone know what I'm doing wrong?

Share this post


Link to post
Share on other sites

This topic is 3743 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.

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