[SlimDx]create mesh form index and vertex buffer
Hi a am using Visual basic with SlimDx, and i want to create a mesh but i don´t know how to load the indexbuffer and the vertexbuffer into the mesh, i put the next code:
Dim malla As New Mesh(device, 2967, 2993, MeshFlags.Dynamic, VertexFormat.Position Or VertexFormat.Diffuse)
And i don´t know how to set the vertexbuffer and the indexbuffer into this new mesh
Quote:Original post by Washu
You need to lock the appropriate buffers and then dump the data into them.
i am a little bit confuse because in directx i did in this way:
Dim malla As New Mesh(2967, 2993, MeshFlags.Dynamic, CustomVertex.PositionTextured.Format, device)
malla.VertexBuffer.SetData(verticest, 0, LockFlags.None)
malla.IndexBuffer.SetData(indices, 0, LockFlags.None)
but slimdx hasn´t the option malla.vertexbuffer.setdata so i don´t know how to do it.
Anyone has a little example?
See the BaseMesh.LockVertexBuffer(LockFlags)(LockFlags) and BaseMesh.LockIndexBuffer(LockFlags) methods in the SlimDX Documentation.
i am watching the slimdx documentatiom but it hasn´t some explanation about BaseMesh.LockvertexBuffer and BaseMesh.LockIndexBuffer
Quote:Original post by jor1980
i am watching the slimdx documentatiom but it hasn´t some explanation about BaseMesh.LockvertexBuffer and BaseMesh.LockIndexBuffer
That's because you are expected to look at the STRANGELY SIMILARLY named methods in the DirectX documentation
SlimDX is a light wrapper around DirectX. As such, almost all functions in SlimDX have a counterpart in DirectX.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement