Skip to main content
gamedev.net
๐Ÿ”’ Locked

[.net] changing vertex buffer data

Started by ssdred Aug 25, 2006 at 4:54 PM 0 replies 650+ views
Original Post
ssdred
ssdred
Hi, all! Can you explain me how to modify vertex buffers data? When I locked it CustomVertex.PositionColored[] vert = (CustomVertex.PositionColored[])vertexBuffer.Lock(0, LockFlags.None); variable vert filled with zero. In this case I must fill vertex buffer complitely again. I think its wrong way and must be another more efficive way. Sorry for my english. It is not my native language.
RipTorn
RipTorn
ok...

so you want to update a portion of the buffer?

eg:

byte[] update = new byte[64]; // only update 64 bytes
int startAt = 128; // start 128 bytes in

vb.SetData(update,startAt,LockFlags.None);

should work...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.