D3D Enumeration
-
hi,
ich versuche momentan einen Dialog zur Grafikkartenauswhl zu programmieren...
Er funktioniert auch schon teilweise:
- Er zeigt schön alle Adapter an und man kann sie auswählen
- Man kann zwischen Softwaremodus und ggf. Hardwarebeschleunigung
wählen
- Man kann zwischen Fenster- oder Vollbildmodus wählen
- Man kann den Videomodus wählen
- Man kann teilweise den Backbuffer wählen
- Er zeigt die Z-Stencil-Buffer-Formate anMeine Fragen:
1.) Bei gewähltem Vollbildmodus kommen nur Videomodi mit 32 Bit
hat sich erledigt... da hat was gaaanz kleines gefehlt
2.) Bei gewähltem Software-Modus kommt kein Backbufferformat zur
AuswahlDas check ich gar nich....
Kann es sein, dass man bei den Funktionen CheckDeviceFormat und
CheckDeviceType D3DDEVTYPE_HAL angeben MUSS?
Hier ist der Code:int temp_bbpos =0; bool bHardwareFormatConversation; char acBackBufferString[256]; D3DFORMAT aFormat[] = {D3DFMT_A2R10G10B10, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_R5G6B5, D3DFMT_X1R5G5B5, D3DFMT_A1R5G5B5}; for(int x=0; x < 6; x++) { if((g_pD3D->CheckDeviceFormat(iCur_Adapter,info[iCur_Adapter].DevType,info[iCur_Adapter].mode.Format, D3DUSAGE_RENDERTARGET,D3DRTYPE_SURFACE,aFormat[x])) == D3D_OK) { if(SUCCEEDED(g_pD3D->CheckDeviceType(iCur_Adapter,info[iCur_Adapter].DevType,info[iCur_Adapter].mode.Format, aFormat[x],info[iCur_Adapter].bWindowed))) { bHardwareFormatConversation = true; if(info[iCur_Adapter].bWindowed && (aFormat[x] != info[iCur_Adapter].mode.Format)) { if(FAILED(g_pD3D->CheckDeviceFormatConversion(iCur_Adapter,info[iCur_Adapter].DevType,info[iCur_Adapter].mode.Format,aFormat[x]))) { bHardwareFormatConversation = false; MessageBox(0,"keine HardwareFormatConversation möglich","Fehler",0); } } if(bHardwareFormatConversation) { GetFormatString(aFormat[x],acBackBufferString); if(info[iCur_Adapter].bWindowed) { sprintf(acBackBufferString, "%s %s", acBackBufferString, aFormat[x] != info[iCur_Adapter].mode.Format ? "(Hardwarekonv.)" : ""); } SendDlgItemMessage(hWindowDlg, IDC_SETBACK, CB_ADDSTRING,0, (LPARAM)(acBackBufferString)); info[iCur_Adapter].BackBufferFormats[temp_bbpos]=aFormat[x]; temp_bbpos++; } } } }
Das war's eigentlich "schon"!
Ich hoff mal, ihr wisst des....
thnx,
cYa[ Dieser Beitrag wurde am 27.06.2003 um 16:23 Uhr von PhilipS editiert. ]