HRESULT APIENTRY hkIDirect3D9::CheckDeviceMultiSampleType(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) { SDLOG(0, "CheckDeviceMultiSampleType adapter %u, device %s, surfaceformat: %s, windowed %s, multisampletype: %s\n", Adapter, D3DDevTypeToString(DeviceType), D3DFormatToString(SurfaceFormat), Windowed?"true":"false", D3DMultisampleTypeToString(MultiSampleType)); HRESULT res = m_pD3Dint->CheckDeviceMultiSampleType(Adapter, DeviceType, SurfaceFormat, Windowed, MultiSampleType, pQualityLevels); SDLOG(0, " -> %s / q: %d\n", res == D3D_OK ? "OK" : "NOT OK!", pQualityLevels ? *pQualityLevels : -1); return res; }
HRESULT APIENTRY hkIDirect3D9::CheckDeviceFormat(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) { SDLOG(0, "CheckDeviceFormat adapter %u, device %s, adapterformat: %s, usage: %u, resource: %s, checkformat: %s\n", Adapter, D3DDevTypeToString(DeviceType), D3DFormatToString(AdapterFormat), Usage, D3DResourceTypeToString(RType), D3DFormatToString(CheckFormat)); HRESULT res = m_pD3Dint->CheckDeviceFormat(Adapter, DeviceType, AdapterFormat, Usage, RType, CheckFormat); SDLOG(0, " -> %s\n", res == D3D_OK ? "OK" : "NOT OK!"); return res; }
//----------------------------------------------------------------------------- // Name: AdapterChanged // Desc: Respond to a change of selected adapter. //----------------------------------------------------------------------------- void CD3DSettingsDialog::AdapterChanged( void ) { D3DAdapterInfo* pAdapterInfo = (D3DAdapterInfo*)ComboBoxSelected( IDC_ADAPTER_COMBO ); if( pAdapterInfo == NULL ) return; if( m_d3dSettings.IsWindowed ) m_d3dSettings.pWindowed_AdapterInfo = pAdapterInfo; else m_d3dSettings.pFullscreen_AdapterInfo = pAdapterInfo; // Update device combo box ComboBoxClear( IDC_DEVICE_COMBO ); for( UINT idi = 0; idi < pAdapterInfo->pDeviceInfoList->Count(); idi++ ) { D3DDeviceInfo* pDeviceInfo = (D3DDeviceInfo*)pAdapterInfo->pDeviceInfoList->GetPtr(idi); ComboBoxAdd( IDC_DEVICE_COMBO, pDeviceInfo, D3DDevTypeToString( pDeviceInfo->DevType ) ); if( pDeviceInfo->DevType == m_d3dSettings.DevType() ) ComboBoxSelect( IDC_DEVICE_COMBO, pDeviceInfo ); } if( !ComboBoxSomethingSelected( IDC_DEVICE_COMBO ) && ComboBoxCount( IDC_DEVICE_COMBO ) > 0 ) { ComboBoxSelectIndex( IDC_DEVICE_COMBO, 0 ); } }
HRESULT APIENTRY hkIDirect3D9::CheckDepthStencilMatch(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) { SDLOG(0, "CheckDepthStencilMatch adapter %u, device %s, adapterformat: %s, renderformat: %s, depthformat: %s\n", Adapter, D3DDevTypeToString(DeviceType), D3DFormatToString(AdapterFormat), D3DFormatToString(RenderTargetFormat), D3DFormatToString(DepthStencilFormat)); HRESULT res = m_pD3Dint->CheckDepthStencilMatch(Adapter, DeviceType, AdapterFormat, RenderTargetFormat, DepthStencilFormat); SDLOG(0, " -> %s\n", res == D3D_OK ? "OK" : "NOT OK!"); return res; }
/** * Call when adapter selection changed. This will reset device * combobox, list devices for new adapter, and call ChangedDevice(). */ void ZFXD3DEnum::ChangedAdapter(void) { ZFXADAPTERINFO *pA=NULL; // delete content of device combobox SendMessage(m_hDEVICE, CB_RESETCONTENT, 0, 0); pA = (ZFXADAPTERINFO *)GetSelectedItem(m_hADAPTER); for (UINT d=0; d<pA->nNumDevs; d++) { AddItem(m_hDEVICE, D3DDevTypeToString(pA->d3dDevs[d]. d3dDevType), &pA->d3dDevs[d]); } SendMessage(m_hDEVICE, CB_SETCURSEL, (WPARAM)0, 0); // treat as if device slectio changed ChangedDevice(); } // ChangedAdapter