Skip to content

Commit

Permalink
Fixed detecting output on second adapter
Browse files Browse the repository at this point in the history
CR: Sam Lantinga
  • Loading branch information
slouken committed Apr 23, 2014
1 parent 3e3570d commit 45dc89c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/video/windows/SDL_windowsvideo.c
Expand Up @@ -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");
Expand All @@ -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))) {
Expand Down

0 comments on commit 45dc89c

Please sign in to comment.