Hi am trying to make one tutorial of physx in slimdx but i get en error writing the vertexbuffer:
the error message saids: don´t valid operation because of the actual state of the object.
here is my debug message:
[5760] Direct3D9: :====> ENTER: DLLMAIN(5117a170): Process Attach: 00001680, tid=00000b70
[5760]
[5760] Direct3D9: :====> EXIT: DLLMAIN(5117a170): Process Attach: 00001680
[5760]
[5760] Direct3D9: (INFO) :Direct3D9 Debug Runtime selected.
[5760]
[5760] Direct3D9: (INFO) :======================= Hal SWVP device selected
[5760]
[5760] Direct3D9: (INFO) :HalDevice Driver Style b
[5760]
[5760] Direct3D9: :DoneExclusiveMode
[5760]
[5760] Direct3D9: (INFO) :Using FF to PS converter
[5760]
[5760] Direct3D9: (WARN) :Athlon32Compiler: CPU does not meet minimum requirements
[5760]
[5760] Direct3D9: (INFO) :Using P4 PSGP
[5760]
[5760] Direct3D9: (INFO) :Using FF to VS converter in software vertex processing
[5760]
[5760] D3D9 Helper: Warning: Default value for D3DRS_POINTSIZE_MAX is 2.19902e+012f, not 6.96009e-316f. This is ok.
and here the function where i create the verxtexbuffer:
Protected Overloads Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
device.Clear(ClearFlags.Target Or ClearFlags.ZBuffer, Color.Black.ToArgb, 1.0F, 0)
Dim debugrenderables As DebugRenderable = gscene.GetDebugRenderable
Dim triangles As DebugTriangle() = debugrenderables.GetDebugTriangles
Dim Points As DebugPoint() = debugrenderables.GetDebugPoints
Dim lines As DebugLine() = debugrenderables.GetDebugLines
Dim Vb As VertexBuffer = New VertexBuffer(device, lines.Length * 2 * 16, Usage.WriteOnly, VertexFormat.Position Or VertexFormat.Diffuse, Pool.Managed)
Dim vertices As MyOwnVertexFormat() = New MyOwnVertexFormat((lines.Length * 2) - 1) {}
For i = 0 To lines.Length - 1
vertices((i * 2)) = New MyOwnVertexFormat(lines(i).Point0, Color.Lime)
vertices((i * 2) + 1) = New MyOwnVertexFormat(lines(i).Point1, Color.Lime)
Next
Dim datStre As DataStream = Vb.Lock(0, 0, LockFlags.None)
datStre.WriteRange(vertices)
Vb.Unlock()
device.BeginScene()
device.SetStreamSource(0, Vb, 0, 16)
device.DrawPrimitives(PrimitiveType.LineList, 0, 30)
device.EndScene()
device.Present()
Me.Invalidate()
End Sub