I have a particle system where sparks burn out over time.
Instead of creating a brand new VertexArray every frame with the burnt-out particles removed, I wanted to re-use the same VertexArray and just shift things around so that the burnt-out ones are on the end, and then not draw them by passing a count parameter to the Draw function. The idea is by not creating a new VertexArray every frame this should be much more performant.
But it seems the window.Draw function does not quite give me the overload I need.
renderWindow.Draw(vertexArray, 0, vertexCount, vertexArray.PrimitiveType);
This is invalid code because the first parameter needs to be an array of vertices instead of a vertexArray
but the VertexArray class does not expose its internal array of vertices. So any way I can do this?