Public Function ChangeConfig(ByRef sDDrawGuid As String, ByRef sRasterizerGuid As String, ByRef w As Long, ByRef h As Long, ByRef bpp As Long, ByRef bFullscreen As Boolean, ByRef bShowfps As Boolean) As Boolean
m_bFullscreen = bFullscreen
m_bShowFps = bShowfps
m_bpp = bpp
m_w = w
m_h = h
m_sDDrawGuid = sDDrawGuid
m_sRasterizerGuid = sRasterizerGuid
FillDDrawEnum
Dim i As Long
'Find the DDraw Guid in the combo list
For i = 1 To m_dden.GetCount()
If UCase(m_dden.GetGuid(i)) = UCase(sDDrawGuid) Then
cmbHardware.ListIndex = i - 1
Exit For
End If
Next
'if we did not find one- select the first one in the list
If i = m_dden.GetCount + 1 Then cmbHardware.ListIndex = 0
'Find rasterizer in the combo list
For i = 1 To m_rast.GetCount()
If UCase(m_rast.GetGuid(i)) = UCase(sRasterizerGuid) Then
cmbRasterizer.ListIndex = i - 1
Exit For
End If
Next
'if we did not find one- select the first one in the list
If i = m_rast.GetCount + 1 Then cmbRasterizer.ListIndex = 0
'Find the resolution
Dim info As DDSURFACEDESC2
If Not bFullscreen Then
cmbResolution.ListIndex = 0
Else
For i = 1 To m_modes.GetCount()
m_modes.GetItem i, info
If info.ddpfPixelFormat.lRGBBitCount = bpp And _
info.lWidth = w And _
info.lHeight = h Then
cmbResolution.ListIndex = i
Exit For
End If
Next
End If
Me.Show 1
If m_bCommit Then
If cmbResolution.ListIndex = 0 Then
bFullscreen = False
Else
m_modes.GetItem cmbResolution.ListIndex, info
If (info.ddpfPixelFormat.lRGBBitCount <= 8) Then
MsgBox "D3DIM application must run in 16 bpp color or better"