hopeless-programmer
hopeless-programmer

Reputation: 990

Move window and present swapchain in one transaction

I'm working on a custom GUI/overlay renderer using WinAPI and DirectX11. The entire GUI is rendered in a semi-transparent floating window and the client area of it is constantly adjusted to match the current boundaries of UI elements. When the elements are moved outside the client area I have to move/resize the window and also redraw its content. But there is a problem: if I first present the changes (IDXGISwapChain::Present()) and then move the window, there will be one frame between these operations with the correct content but in the wrong place. If I do the opposite - move the window first - then there will be one frame with the incorrect content (from the previous frame) but in a correct position. Is there a way to do both SetWindowPos() and IDXGISwapChain::Present() in a single transaction?

Upvotes: 0

Views: 101

Answers (0)

Related Questions