Original Post
Hello Gamedev! I'm developping a 2D engine and I'd like a way to batch my sprites so that my rendering is more efficient. Currently, I'm doing the following, which I am pretty sure is a very slow technique : - Hold a MyVertexStruct array of four vertices (simply MyVertexStruct v[4]) - When rendering a sprite, set the four vertices and call Device->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,*,*,*); I still manage to show a couple of thousand of sprites/particles on screen but I'm sure there are better ways to do this. I've thought about using vertex buffers but I have two problems : 1- I cannot batch sprites with different textures in the same buffer and render them at once. 2- World matrices might have changed between each addition of sprites in the buffer. I've thought of using my first technique for sprites and have a special function StartBatch() to accumulate vertices which share the same texture and world matrix in a buffer (mostly for particle systems), and then call EndBatch() to draw them. Would that be the best way to do it?