gpt4 book ai didi

c++ - DX10 SwapChain ResizeBuffers(...) 与 ResizeTarget(...)

转载 作者:太空宇宙 更新时间:2023-11-04 14:25:15 26 4
gpt4 key购买 nike

有什么区别? Google/MSDN 似乎没有任何信息。

MSDN:

ResizeBuffers

ResizeTarget

最佳答案

在搜索完全不同的东西时发现了这个......

来自MSDN

... DXGI resizes the front buffer to match the newly selected full-screen mode, and it sends a WM_SIZE message to the application. The application again calls ResizeBuffers, just as it would if the window border was dragged.

The methodology of the preceding explanation follows a very particular path. DXGI set the full-screen resolution to the desktop resolution by default. Many applications, however, switch to a preferred full-screen resolution. In such a case, DXGI provides IDXGISwapChain::ResizeTarget. This should be called before calling SetFullscreenState. Although these methods can be called in the opposite order (SetFullscreenState first, followed by ResizeTarget), doing so causes an extra WM_SIZE message to be sent to the application. (Doing so can also cause flickering, since DXGI could be forced to perform two mode changes.) After calling SetFullscreenState, it is advisable to call ResizeTarget again with the RefreshRate member zeroed out. This amounts to a no-operation instruction in DXGI, but it can avoid issues with the refresh rate, which are discussed next.

When in full-screen mode, the Desktop Window Manager is disabled. DXGI can perform a flip to present the back buffer contents instead of doing a blit, which it would do in windowed mode. This performance gain can be undone, however, if certain requirements are not met. To ensure that DXGI does a flip instead of a blit, the front buffer and back buffer must be sized identically. If the application correctly handles its WM_SIZE messages, this should not be a problem. Also, the formats must be identical.

The problem for most applications is the refresh rate. The refresh rate that is specified in the call to ResizeTarget must be a refresh rate that is enumerated by the IDXGIOutput object that the swap chain is using. DXGI can automatically calculate this value if the application zeroes out the RefreshRate member of the DXGI_MODE_DESC that is passed into ResizeTarget. ...

关于c++ - DX10 SwapChain ResizeBuffers(...) 与 ResizeTarget(...),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4486309/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com