class SFML::VertexArray

Batched geometry: a single CSFML draw call shipping many vertices to the GPU at once. This is how you draw thousands of particles, custom meshes, or tile maps without the per-shape overhead.

va = SFML::VertexArray.new(:triangles) va << SFML::Vertex.new([100, 100], color: SFML::Color.red) va << SFML::Vertex.new([200, 100], color: SFML::Color.green) va << SFML::Vertex.new([150, 200], color: SFML::Color.blue) window.draw(va)

Primitive types control how vertices form geometry: :points one isolated point per vertex :lines pairs of vertices form line segments :line_strip consecutive vertices form a chain of segments :triangles triples form independent triangles :triangle_strip each new vertex extends the strip :triangle_fan every vertex shares a fan-out with vertex 0