[SlimDx]create mesh form index and vertex buffer

Started by
4 comments, last by Washu 14 years, 2 months ago
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
Advertisement
You need to lock the appropriate buffers and then dump the data into them.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

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.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

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.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

This topic is closed to new replies.

Advertisement