Fixed detecting output on second adapter
authorSam Lantinga <slouken@libsdl.org>
Wed, 23 Apr 2014 13:48:01 -0700
changeset 8736bd7629d87774
parent 8735 2134fc16252b
child 8737 0db0c21fd3ec
Fixed detecting output on second adapter

CR: Sam Lantinga
src/video/windows/SDL_windowsvideo.c
     1.1 --- a/src/video/windows/SDL_windowsvideo.c	Wed Apr 23 13:47:57 2014 -0700
     1.2 +++ b/src/video/windows/SDL_windowsvideo.c	Wed Apr 23 13:48:01 2014 -0700
     1.3 @@ -287,8 +287,8 @@
     1.4      IDXGIFactory *pDXGIFactory;
     1.5      IDXGIAdapter *pDXGIAdapter;
     1.6      IDXGIOutput* pDXGIOutput;
     1.7 -    int nAdapter = 0, nOutput = 0;
     1.8      char *displayName;
     1.9 +    int nAdapter, nOutput;
    1.10  
    1.11      if (!adapterIndex) {
    1.12          SDL_InvalidParamError("adapterIndex");
    1.13 @@ -314,7 +314,9 @@
    1.14      }
    1.15  
    1.16      displayName = WIN_StringToUTF8(pData->DeviceName);
    1.17 +    nAdapter = 0;
    1.18      while (*adapterIndex == -1 && SUCCEEDED(IDXGIFactory_EnumAdapters(pDXGIFactory, nAdapter, &pDXGIAdapter))) {
    1.19 +        nOutput = 0;
    1.20          while (*adapterIndex == -1 && SUCCEEDED(IDXGIAdapter_EnumOutputs(pDXGIAdapter, nOutput, &pDXGIOutput))) {
    1.21              DXGI_OUTPUT_DESC outputDesc;
    1.22              if (SUCCEEDED(IDXGIOutput_GetDesc(pDXGIOutput, &outputDesc))) {