Dim DevType As DeviceType
Dim CFlags As CreateFlags
Dim Caps As Caps = D3d.GetCaps()
Dim PP As New Microsoft.DirectX.Direct3D.PresentParameters
DevType = DeviceType.Hardware
CFlags = CreateFlags.SoftwareVertexProcessing
If Caps.DeviceCaps.SupportsHardwareTransformAndLight Then
CFlags = CreateFlags.HardwareVertexProcessing
End If
If Caps.DeviceCaps.SupportsPureDevice Then
CFlags = CFlags Or CreateFlags.PureDevice
Debug.WriteLine("PureDevice")
End If
PP.BackBufferCount = 1
FileOpen(1, Application.StartupPath & "\config.cfg", OpenMode.Input)
Input(1, PP.BackBufferWidth) '1024
Input(1, PP.BackBufferHeight) '768
Input(1, PP.BackBufferFormat)'A8R8G8B8
FileClose(1)
PP.Windowed = False
PP.SwapEffect = Microsoft.DirectX.Direct3D.SwapEffect.Discard
PP.AutoDepthStencilFormat = DepthFormat.D16
PP.EnableAutoDepthStencil = True
PP.PresentFlag = PresentFlag.None
MainForm.Show()
If Not D3d.Initialize(DevType, MainForm, CFlags, PP) Then
End
End If