DirectX9 window resizing at runtime without reset device

Q: C ++ \ Win32 application (not in full screen mode) \ DX9

How can I redraw the contents of a window while resizing quickly and well enough? Resize custom drag window.

Different approaches:

  • Reset on each WM_SIZE \ WM_PAINT. Adequate resolution, but black bars appear at high speeds.
  • Reset to WM_EXITSIZEMOVE and pause WM_ENTERSIZEMOVE. Better speed, but up to ugly ~ black bars during resizing.
  • Unable to learn how to use swapchain dx9 in this case
  • Keep rendering and replacing buffers during resizing; reset to WM_EXITSIZEMOVE. Exactly what has been happening in official demos since the 2010 SDK. It looks fast and acceptable. But [suddenly] on slow computer black stripes reappeared. Thin and rare, but real. In fact, this is very strange : synchronous rendering and Present(,,,) on each WM_SIZE and \ or WM_PAINT exclude this at first glance. And on the second. Perhaps I do not understand something important?

So, when the last method failed, I decided to ask here. Is it possible to somehow make the dx9 surface firmly glued to the window border. No black bars. Prefer slow scaling down, but sync it somehow with DX.

+6
source share
1 answer

I select a buffer buffer large enough for the maximum client size in the window and set the viewport that corresponds to the current window window size to WM_SIZE. Then I issue accordingly. be present only in this viewport. Thus, a reset device is not required.

+4
source

Source: https://habr.com/ru/post/956737/


All Articles