Added SDL_DXGIGetOutputInfo which returns the adapter and output indices that are used to create DX10 and DX11 devices and swap chains on a particular display.

CR: SamL
This commit is contained in:
Sam Lantinga
2014-02-13 11:05:30 -08:00
parent e34da6801f
commit c52c91056b
5 changed files with 100 additions and 2 deletions

View File

@@ -706,6 +706,7 @@ SDLTest_CommonInit(SDLTest_CommonState * state)
Uint32 Rmask, Gmask, Bmask, Amask;
#if SDL_VIDEO_DRIVER_WINDOWS
int adapterIndex = 0;
int outputIndex = 0;
#endif
n = SDL_GetNumVideoDisplays();
fprintf(stderr, "Number of displays: %d\n", n);
@@ -761,9 +762,13 @@ SDLTest_CommonInit(SDLTest_CommonState * state)
}
#if SDL_VIDEO_DRIVER_WINDOWS
/* Print the adapter index */
/* Print the D3D9 adapter index */
adapterIndex = SDL_Direct3D9GetAdapterIndex( i );
fprintf( stderr, "Adapter Index: %d", adapterIndex );
fprintf( stderr, "D3D9 Adapter Index: %d", adapterIndex );
/* Print the DXGI adapter and output indices */
SDL_DXGIGetOutputInfo(i, &adapterIndex, &outputIndex);
fprintf( stderr, "DXGI Adapter Index: %d Output Index: %d", adapterIndex, outputIndex );
#endif
}
}