cypher543
05-03-2006, 02:18 PM
I'm finally learning to work with DirectX... but the experience has not been good so far. I can't even get the device to start! I get the following error when I try to run my application:
Code: -2005530516
Message: Error in the application.
String: D3DERR_INVALIDCALL
I am using Visual Basic .NET 2005 Express and DirectX 9.0c. The code for my StartDirectX() method is below:
If deviceCaps.DeviceCaps.SupportsHardwareTransformAnd Light Then
newFlags = CreateFlags.HardwareVertexProcessing
Else
newFlags = CreateFlags.SoftwareVertexProcessing
End If
If deviceCaps.DeviceCaps.SupportsPureDevice And newFlags = CreateFlags.HardwareVertexProcessing Then
newFlags &= CreateFlags.PureDevice
End If
Dim presentParams As New PresentParameters
presentParams.SwapEffect = SwapEffect.Discard
presentParams.Windowed = True
d3dDevice = New Device(defaultAdapter, DeviceType.Hardware, ContagionForm.Handle.ToInt32, newFlags, presentParams)
All of my variables have been defined:
Dim d3dDevice As Device
Dim defaultAdapter As Integer = Manager.Adapters.Default.Adapter
Dim deviceCaps As Caps = Manager.GetDeviceCaps(defaultAdapter, DeviceType.Hardware)
Dim newFlags As CreateFlags
So what is the problem? I can't believe DirectX doesn't give any more detail than "Error in the application"! Any ideas?
BTW, I did search the forums (using the error code as the string) before I posted, but the only topic I found that seemed to be relevant went off topic into a discussion about a college professor and never provided a clear answer to the problem.
Code: -2005530516
Message: Error in the application.
String: D3DERR_INVALIDCALL
I am using Visual Basic .NET 2005 Express and DirectX 9.0c. The code for my StartDirectX() method is below:
If deviceCaps.DeviceCaps.SupportsHardwareTransformAnd Light Then
newFlags = CreateFlags.HardwareVertexProcessing
Else
newFlags = CreateFlags.SoftwareVertexProcessing
End If
If deviceCaps.DeviceCaps.SupportsPureDevice And newFlags = CreateFlags.HardwareVertexProcessing Then
newFlags &= CreateFlags.PureDevice
End If
Dim presentParams As New PresentParameters
presentParams.SwapEffect = SwapEffect.Discard
presentParams.Windowed = True
d3dDevice = New Device(defaultAdapter, DeviceType.Hardware, ContagionForm.Handle.ToInt32, newFlags, presentParams)
All of my variables have been defined:
Dim d3dDevice As Device
Dim defaultAdapter As Integer = Manager.Adapters.Default.Adapter
Dim deviceCaps As Caps = Manager.GetDeviceCaps(defaultAdapter, DeviceType.Hardware)
Dim newFlags As CreateFlags
So what is the problem? I can't believe DirectX doesn't give any more detail than "Error in the application"! Any ideas?
BTW, I did search the forums (using the error code as the string) before I posted, but the only topic I found that seemed to be relevant went off topic into a discussion about a college professor and never provided a clear answer to the problem.