Sign in to follow this  

flickering

This topic is 4726 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 program which is utilizing DirectX9, I have another program which gets the DC of the DX9 program's window and draws to it, over whatever the DX9 surface is displaying. I get some flicker which is really really irritating and I'm wondering, is there any way to avoid this? At the moment I'm just drawing text with TextOut and LineTo to draw lines in a loop. Nothing fancy just drawing some trajectory lines of projectiles. Any help appreciated.

Share this post


Link to post
Share on other sites
Hmm. Well, in general it's a bad idea to mix rendering API's like this. I don't know what language you're using, so I don't know the circumstances, but in Visual Basic I would disable AutoRedraw while I draw using the Win32 API, and then re-enable it afterward, prior to calling DoEvents. This usually solves flicker problems. . . but when you mix API's, it's really hard to predict what might happen. My advice: stick with DX9 for all output.

Share this post


Link to post
Share on other sites
I'm using managed c++. It would be simple if I had the source to both programs, but I don't. One program was not developed by me. Is there any way I could access the display surface with D3D9 even if it's related to a device owned by another program?

Share this post


Link to post
Share on other sites
Quote:
Original post by TeknoMoose
I have a program which is utilizing DirectX9, I have another program which gets the DC of the DX9 program's window and draws to it, over whatever the DX9 surface is displaying. I get some flicker which is really really irritating and I'm wondering, is there any way to avoid this? At the moment I'm just drawing text with TextOut and LineTo to draw lines in a loop. Nothing fancy just drawing some trajectory lines of projectiles. Any help appreciated.

Basically, both APIs are fighting for the surface - each one draws over the other, giving you the horrible flicker. What you want to do can be achieved by providing a replacement d3d9.dll, where you replace some interface methods (e.g. IDirect3DDevice9::Present) with your own methods that do the additional magic. That way the 3rd party program uses your DLL, and you get to draw over its surface.

I think circlesoft's done something like this before, not sure how though. He's generally around, and hopefully he'll see this and elaborate with bits of uber-wisdom [grin]

Share this post


Link to post
Share on other sites

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