1 votes

error C2228 : left of '.DXGI_MODE' must have class/struct/union Direct X

J'essaie de configurer mon tampon de chaîne d'échange mais j'obtiens l'erreur suivante

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

Je ne suis pas sûr de ce que je fais mal. Voici le code

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;

2voto

AakashM Points 32891

Ce passage ne devrait-il pas

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

en fait être

swapChainDesc.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;

?

1voto

Nikolai N Fetissov Points 52093

Vous voulez dire

swapChainDesc.BufferDesc.ScanlineOrdering = DXGI_MODE;

au lieu de

swapChainDesc.BufferDesc.ScanlineOrdering.DXGI_MODE;

1voto

Georg Fritzsche Points 59185

swapChainDesc.BufferDesc.ScanlineOrdering est un enum DXGI_MODE_SCANLINE_ORDER et non un type de classe.

Utilisez plutôt quelque chose comme ce qui suit :

swapChainDesc.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;

Prograide.com

Prograide est une communauté de développeurs qui cherche à élargir la connaissance de la programmation au-delà de l'anglais.
Pour cela nous avons les plus grands doutes résolus en français et vous pouvez aussi poser vos propres questions ou résoudre celles des autres.

Powered by:

X