mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-09 07:20:40 +00:00
GFX now handles non-default adapters
The GFX (DirectX) pipeline did not respect the choice of adapter and always went for the default one. Normally this isn't an issue unless you wish to target a particular adapter and display device combination. This has been corrected. The GFX initialize functions now attempt to find the best adapter that matches a given display device (i.e. monitor) if one has been passed in. To aid with choosing a display device some new monitor enumeration methods have been added to the platform window manager. These methods have been exposed to the Canvas.
This commit is contained in:
parent
1ed1a41256
commit
0d77cdc270
18 changed files with 282 additions and 45 deletions
|
|
@ -119,7 +119,7 @@ struct DXDIAG_INIT_PARAMS
|
|||
|
||||
struct IDxDiagContainer : public IUnknown
|
||||
{
|
||||
virtual HRESULT STDMETHODCALLTYPE GetNumberOfChildContaiiners( DWORD* pdwCount ) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetNumberOfChildContainers( DWORD* pdwCount ) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE EnumChildContainerNames( DWORD dwIndex, LPWSTR pwszContainer, DWORD cchContainer ) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetChildContainer( LPCWSTR pwszContainer, IDxDiagContainer** ppInstance ) = 0;
|
||||
virtual HRESULT STDMETHODCALLTYPE GetNumberOfProps( DWORD* pdwCount ) = 0;
|
||||
|
|
@ -361,6 +361,28 @@ bool WMIVideoInfo::_queryPropertyDxDiag( const PVIQueryType queryType, const U32
|
|||
IDxDiagContainer* displayDevicesContainer = 0;
|
||||
IDxDiagContainer* deviceContainer = 0;
|
||||
|
||||
// Special case to deal with PVI_NumAdapters
|
||||
if(queryType == PVI_NumAdapters)
|
||||
{
|
||||
DWORD count = 0;
|
||||
String value;
|
||||
|
||||
if( mDxDiagProvider->GetRootContainer( &rootContainer ) == S_OK
|
||||
&& rootContainer->GetChildContainer( L"DxDiag_DisplayDevices", &displayDevicesContainer ) == S_OK
|
||||
&& displayDevicesContainer->GetNumberOfChildContainers( &count ) == S_OK )
|
||||
{
|
||||
value = String::ToString("%d", count);
|
||||
}
|
||||
|
||||
if( rootContainer )
|
||||
SAFE_RELEASE( rootContainer );
|
||||
if( displayDevicesContainer )
|
||||
SAFE_RELEASE( displayDevicesContainer );
|
||||
|
||||
*outValue = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
WCHAR adapterIdString[ 2 ];
|
||||
adapterIdString[ 0 ] = L'0' + adapterId;
|
||||
adapterIdString[ 1 ] = L'\0';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue