Scalpweb
Messages postés
1467
Date d'inscription
samedi 13 mars 2004
Statut
Membre
Dernière intervention
5 mai 2010
4
24 août 2004 à 14:32
Alors c facile :
Dim mode As D3DDISPLAYMODE
d3d.GetAdapterDisplayMode D3DADAPTER_DEFAULT, mode
If windowed = True Then
Dim d3dPP As D3DPRESENT_PARAMETERS
d3dPP.windowed = True
d3dPP.SwapEffect = D3DSWAPEFFECT_COPY_VSYNC
d3dPP.BackBufferFormat = mode.Format
d3dPP.EnableAutoDepthStencil = 1
d3dPP.AutoDepthStencilFormat = D3DFMT_D16
If d3d.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, mode.Format, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D16) = D3D_OK Then
d3dPP.AutoDepthStencilFormat = D3DFMT_D16
End If
If d3d.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, mode.Format, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D16_LOCKABLE) = D3D_OK Then
d3dPP.AutoDepthStencilFormat = D3DFMT_D16_LOCKABLE
End If
If d3d.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, mode.Format, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D24S8) = D3D_OK Then
d3dPP.AutoDepthStencilFormat = D3DFMT_D24S8
End If
If d3d.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, mode.Format, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D24X4S4) = D3D_OK Then
d3dPP.AutoDepthStencilFormat = D3DFMT_D24X4S4
End If
If d3d.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, mode.Format, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D24X8) = D3D_OK Then
d3dPP.AutoDepthStencilFormat = D3DFMT_D24X8
End If
If d3d.CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, mode.Format, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, D3DFMT_D32) = D3D_OK Then
d3dPP.AutoDepthStencilFormat = D3DFMT_D32
End If
Else
mode.Format = D3DFMT_R5G6B5
mode.Width = 640
mode.Height = 480
d3dPP.SwapEffect = D3DSWAPEFFECT_FLIP
d3dPP.BackBufferCount = 1
d3dPP.BackBufferFormat = mode.Format
d3dPP.BackBufferWidth = 640
d3dPP.BackBufferHeight = 480
d3dPP.hDeviceWindow = frm.hWnd
End If
Set d3dDevice = d3d.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, frm.hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, d3dPP)
VOilà à peu près ce qui pourrait répondre à tes 2 questions...
Ensuite, tu peux toujours faire un truc du genre :
' Mise en place des infos :
d3d.GetDeviceCaps cbAdapts.ListIndex, nMethode, caps
' Analyse et affichage :
lstOptions.AddItem "Taille maximale d'un point : " & caps.MaxPointSize
lstOptions.AddItem "Taille maximale d'une texture : " & caps.MaxTextureWidth & "x" & caps.MaxTextureHeight
lstOptions.AddItem "Nombre maximum de primitives en un seul appel : " & caps.MaxPrimitiveCount
If caps.MaxActiveLights = -1 Then
lstOptions.AddItem "Nombre maximum de lampes actives : Illimité"
Else
lstOptions.AddItem "Nombre maximum de lampes actives : " & caps.MaxActiveLights
End If
If caps.Caps2 And D3DCAPS2_CANRENDERWINDOWED Then
lstOptions.AddItem "Mode fenêtré supporté !"
End If
If caps.DevCaps And D3DDEVCAPS_HWTRANSFORMANDLIGHT Then
lstOptions.AddItem "Transform and lighting matériel supporté !"
End If
If caps.DevCaps And D3DDEVCAPS_HWRASTERIZATION Then
lstOptions.AddItem "Rasterization matériel supporté !"
End If
If caps.TextureCaps And D3DPTEXTURECAPS_VOLUMEMAP Then
lstOptions.AddItem "Volume Mapping supporté !"
End If
If caps.TextureCaps And D3DPTEXTURECAPS_CUBEMAP Then
lstOptions.AddItem "Cube Mapping supporté !"
End If
If caps.RasterCaps And D3DPRASTERCAPS_ANISOTROPY Then
lstOptions.AddItem "Anisotropic Filtering supporté !"
End If
If caps.Caps2 And D3DCAPS2_CANCALIBRATEGAMMA Then
lstOptions.AddItem "Calibrage du gamma autorisé !"
End If
If caps.Caps2 And D3DCAPS2_FULLSCREENGAMMA Then
lstOptions.AddItem "Calibrage du gamma en plein écran autorisé !"
End If
If caps.DevCaps And D3DDEVCAPS_PUREDEVICE Then
lstOptions.AddItem "Pure Device option supportée !"
End If
If caps.RasterCaps And D3DPRASTERCAPS_ZBUFFERLESSHSR Then
lstOptions.AddItem "Z-Buffer/Depth Buffer non requis !"
End If
' Une dernière option importante :
If caps.TextureCaps And D3DPTEXTURECAPS_SQUAREONLY Then
lstOptions.AddItem "Les textures doivent être carrées !"
End If
Ce prog liste les fonction dispo dans une listBox apellé lstOptions.
Voilà, en éspérant avoir éclairer ta lanterne, @+, scalpweb.