SDL_RenderGeometry is a function provided by the SDL library that allows you to render complex shapes using vertex data. It usually renders triangles, which are the most common primitive used in both 2D and 3D graphics because of their versatility and the fact that any polygon can be broken down into triangles.
As per the SDL documentation, SDL_RenderGeometry is capable of rendering a collection of vertices defined by the user, which can form triangles, lines or points depending on the indices provided. There isn't native support for rendering quads directly; quads would typically be rendered by specifying two triangles that share an edge to form a quadrilateral.
Given this information, here are a few name ideas that stem from the type of primitives you can render with SDL_RenderGeometry:
-
TriangleBatch:
- Since
SDL_RenderGeometry is primarily used for rendering triangles, this name would reflect the main use case directly.
-
TriShape:
- Combines the triangular nature of the geometry with the abstract idea of a shape.
-
VertexShape:
- A name that suggests the class holds vertex data defining some shape.
-
PolygonBatch:
- Even if SDL uses triangles, in a higher-level sense, you might be representing polygons that are triangulated for rendering.
-
ShapeBatch:
- A more general term that indicates a batch of shapes, which does not specify the kinds of primitives used.
-
GeometryBuffer:
- A name that suggests this class functions as a buffer for geometry data.
-
TriMesh:
- Mesh often implies a collection of vertices making up a shape, and TriMesh indicates that triangles are the fundamental building blocks of these shapes.
-
PrimitiveBatch:
- A name that indicates a heterogeneous collection of renderable primitives.
-
Drawables:
- A generic term for objects that can be drawn to the screen.
-
VertexCollection:
- A plain name that puts the emphasis on the collection of vertices without indicating the shape or structures they form.
The best name will depend on how you plan to use the class in practice. If it's exclusively for rendering triangles, then being explicit with "Triangle" in the name makes sense. If the class has a broader purpose and may include other drawing primitives or future extensions, choose a more general name like "ShapeBatch" or "GeometryBuffer."