From 45dc89c2c2093b22f3c4876f73de1a78717b6b94 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 23 Apr 2014 13:48:01 -0700 Subject: [PATCH] Fixed detecting output on second adapter CR: Sam Lantinga --- src/video/windows/SDL_windowsvideo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video/windows/SDL_windowsvideo.c b/src/video/windows/SDL_windowsvideo.c index 87102fe23..ea1595726 100644 --- a/src/video/windows/SDL_windowsvideo.c +++ b/src/video/windows/SDL_windowsvideo.c @@ -287,8 +287,8 @@ SDL_DXGIGetOutputInfo(int displayIndex, int *adapterIndex, int *outputIndex) IDXGIFactory *pDXGIFactory; IDXGIAdapter *pDXGIAdapter; IDXGIOutput* pDXGIOutput; - int nAdapter = 0, nOutput = 0; char *displayName; + int nAdapter, nOutput; if (!adapterIndex) { SDL_InvalidParamError("adapterIndex"); @@ -314,7 +314,9 @@ SDL_DXGIGetOutputInfo(int displayIndex, int *adapterIndex, int *outputIndex) } displayName = WIN_StringToUTF8(pData->DeviceName); + nAdapter = 0; while (*adapterIndex == -1 && SUCCEEDED(IDXGIFactory_EnumAdapters(pDXGIFactory, nAdapter, &pDXGIAdapter))) { + nOutput = 0; while (*adapterIndex == -1 && SUCCEEDED(IDXGIAdapter_EnumOutputs(pDXGIAdapter, nOutput, &pDXGIOutput))) { DXGI_OUTPUT_DESC outputDesc; if (SUCCEEDED(IDXGIOutput_GetDesc(pDXGIOutput, &outputDesc))) {