Vertexbuffer Getdata VertexPositionNormalTexture
I have a Vertexbuffer with 648 VertexPositionNormalTexture elements. That is 27 cubes and each cube hold 24 vertices. If I want to access the vertices for my first cube I can write: int startIndex = 0; VertexPositionNormalTexture vertices = new VertexPositionNormalTexture; vertexBuffer.GetData<VertexPositionNormalTexture>(vertices, startIndex, 24); The problem is if I want to access my 9th cube (24*9 = 216). I have to write: int startIndex = 216; VertexPositionNormalTexture vertices = new VertexPositionNormalTexture[startIndex + 24]; vertexBuffer.GetData<VertexPositionNormalTexture>(vertices, startIndex, 24); I have to create 192 extra slots just to access my 24 elements. Because the vertex.GetData will copy to same index it get data from. How do I do so It write my 24 elements to a correct sized array? All classes, structs and functions are from XNA Framework 4.0
Why you need to use GetData? Save the reference to your array and work with the array... not with the vertexBuffer...
xna 4 taking desktop screenshot
Can't reset my gametime to zero in XNA
Displaying seconds in XNA with Keypress?
XNA game how to make a snake tail
Creating an array of game objects
Lap timer in XNA 4.0?
XNA: Identifying identical sprites created with for loop
Increase Character Spacing in XNA
XNA choosing a subgroup of Game.Components
Loading Silverlight Texture2D from Resources
XNA Game - Open a Popup or a Custom Game Screen before launching a game
'Microsoft.Xna.Framework.Vector2' is a 'type' but is used like a variable?
Making a trading card game XNA
How do I fix 'No suitable method found to override' error on XNA 4.0?
When to use PresentationParameters.BackBufferWidth vs .Viewport.Width
What does the pixel shader function tex1D do with a Texture2d