When exactly is the WinAPI drawing content to the screen?

150 Views Asked by At

I have a setup where I am taking images with a camera from my monitor/screen. The camera is positioned infront of the screen... Camera and monitor are connected to the same PC.

On the screen I am moving a white rectangle on a black background in meandering shape. After each move I am taking an image. My application is written in C++. And the OS is Windows 11.

Image aquisition and GUI are running on different threads. I am synchronizing the threads through a conditional variable. Now I am encountering the problem that I am never really sure when the GUI is updating the screen. My rectangle skips positions.

I need something that gives me the feedback that the rectangle has been drawn. If that is not possible is there something like that the display manager queue is empty? Just so that I can be 100% sure that everything has been drawn.

I have tryed QT and ImGUI. In QT after the paintEvent the drawing through a painter is not drawn directly to the screen. I know that the display manager is gathering changes togather and draw those to the screen. It seem like I do not have access to the display manager. Since ImGUI is working in direct mode I thought it would be better. But unfortunately I encountered the same issue.

0

There are 0 best solutions below