gpt4 book ai didi

c++ - 错误 C2228 : left of '.DXGI_MODE' must have class/struct/union Direct X

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

我正在尝试设置我的交换链缓冲区,但出现以下错误

error C2228: left of '.DXGI_MODE' must have class/struct/union
1> type is 'DXGI_MODE_SCANLINE_ORDER'

注意确定我做错了什么。这是代码

DXGI_SWAP_CHAIN_DESC swapChainDesc;

// Set the width and height of the buffers in the swap chain
swapChainDesc.BufferDesc.Width = 640;
swapChainDesc.BufferDesc.Height = 480;

// Set the refresh rate. This is how often the buffers get swapped out
swapChainDesc.BufferDesc.RefreshRate.Numerator = 60;
swapChainDesc.BufferDesc.RefreshRate.Denominator = 1;

// Set the surface format of the buffers
swapChainDesc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
swapChainDesc.BufferDesc.ScanlineOrdering.DXGI_MODE;
//_SCANLINE_ORDER_UNSPECIFIED;
swapChainDesc.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED;
swapChainDesc.SampleDesc.Count = 1;
swapChainDesc.SampleDesc.Quality = 0;

// Set how the buffers are used. Since you are drawing to the buffers, they are
//considered a render target
swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;

// Set the number of back buffers, 1 is the minimum and normally sufficient
swapChainDesc.BufferCount = 1;

// A handle to the main application window
swapChainDesc.OutputWindow = hWnd;

// Set whether you are running in a window or fullscreen mode
swapChainDesc.Windowed = TRUE;

// How the buffers are swapped. Discard allows the buffers to be overwritten
//completely when swapped.
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
swapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_NONPREROTATED;

最佳答案

应该不会吧

swapChainDesc.BufferDesc.ScanlineOrdering.DXGI_MODE;
//_SCANLINE_ORDER_UNSPECIFIED;

事实上是

swapChainDesc.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;

?

关于c++ - 错误 C2228 : left of '.DXGI_MODE' must have class/struct/union Direct X,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2336368/

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