rifter1818
Junior Contributor
Why doesnt this work? all the variables are set to default however ive tried adjusting the windowed variable neither work can anyone please help me... using managed dx
note that when it errors is allways the last line = new device .....
with the following error:
An unhandled exception of type 'Microsoft.DirectX.Direct3D.InvalidCallException' occurred in microsoft.directx.direct3d.dll
Additional information: Error in the application.
Visual Basic:
public class dx9
Imports Microsoft.DirectX
Imports Microsoft.DirectX.Direct3D
Imports System.Windows.Forms
public d3ddevice as device
Private TargetForm As Form
Private sWidth As Long
Private sHeight As Long
Public Sub Initialize(Optional ByVal windowed As Boolean = False, Optional ByVal ScreenWidth As Long = 1280, Optional ByVal ScreenHeight As Long = 1024, Optional ByVal ColorFormat As Long = 33)
Dim d3dpp As New PresentParameters
TargetForm = New Form
TargetForm.Show()
TargetForm.Focus()
d3dpp.Windowed = windowed
sWidth = ScreenWidth
sHeight = ScreenHeight
d3dpp.BackBufferCount = 1
d3dpp.BackBufferFormat = ColorFormat
d3dpp.BackBufferHeight = ScreenHeight
d3dpp.BackBufferWidth = ScreenWidth
d3dpp.SwapEffect = SwapEffect.Copy
D3DDevice = New Device(0, DeviceType.Hardware, TargetForm, CreateFlags.SoftwareVertexProcessing, d3dpp)
End Sub
end class
with the following error:
An unhandled exception of type 'Microsoft.DirectX.Direct3D.InvalidCallException' occurred in microsoft.directx.direct3d.dll
Additional information: Error in the application.