Open BeamRider opened 4 years ago
I think your texture is properly configured. I do everything almost the same way, and I have no such problem, differences:
The deviced3d.ImmediateContext.Flush() solved the problem to a good extent. I tried it but always before the SetTexture, putting it below did the magic.
Some users are reporting single-shot flashes here and there, but seems not to be a serious problem. This is making me think that synchronization is missing somewhere. A suggestion for the documentation: a proper howto or an example of an high refresh rate DX overlay may be very useful.
@Zaetc many thanks for your help
I'm experiencing flickering/disappearing overlay texture when using SetOverlayTexture with a Texture2D prepared using SharpDx.
I have two threads, one is generating a System.Drawing.Bitmap (a GDI+ bitmap) asynchronously to the the thread handling the overlay. Obviously access to this bitmap is synchronized between the two with a simple locking mechanism.
The overlay thread is doing the following (simplfied code):
The present method is:
And the PrepareTexture:
I'm not sure if the Texture is properly configured for the purpose. Doing a very similar thing with OpenGL worked without any problem.
The overlay will flicker when the update rate of the bitmap is high (a new bitmap is generated every time), but when the update is low, sometimes, the overlay just disappears.
This issue appear to have a similar behavior of #741, but there is no commonality of the listed causes.