# Efficient way to draw multiple separated quads

Let's assume I want to draw several separated (possibly textured) quads in Direct3D 9, each consisting of two triangles:

How should I draw these for maximum performance, i.e. which of the following ways is better in terms of speed?

1. Describe each quad by 4 vertices, use D3DPT_TRIANGLESTRIP and call IDirect3DDevice9::DrawPrimitive for each individual quad, since they are not connected.
2. Describe each quad by 6 vertices, use D3DPT_TRIANGLELIST and call IDirect3DDevice9::DrawPrimitive just once.

The first method uses less memory, while the second one requires only one draw call.

However, the second way seems to be feasible only if all the quads have the same texture, since otherwise a switch would be required.

• Why not just try both and see what kind of performance you get? – OmniOwl Aug 10 '13 at 12:38
• I hoped that somebody could share his experience. If this isn't the case or if a general answer is not possible, I will do my own tests of course. It's just that every tutorial recommends to use D3DPT_TRIANGLESTRIP instead of D3DPT_TRIANGLELIST, but I don't know if this applies to the case of separated sprites as well. – ph4nt0m Aug 10 '13 at 12:50
• On stackexchange sites it's usually expected that you try your approach and then report in if it doesn't work or doesn't work as you expected it to and need answers. These kind of questions are usually a "try and see" :) – OmniOwl Aug 10 '13 at 12:55

Ideally you'd want to combine it with an index buffer and DrawIndexedPrimitive(). That way you'll get one draw call, and only need 4 vertices. The index buffer can be created once on start-up since it'll be exactly the same regardless of what the vertex data is, you just need to tell D3D how much of it to use.