use static, fixed arrays for circle geometry data instead of allocating for each one

This commit is contained in:
2024-10-13 22:32:59 -03:00
parent ffab6a3924
commit f7f27119e1
5 changed files with 18 additions and 23 deletions

View File

@ -126,12 +126,14 @@ void render(void);
/* clears all render queues */
void render_queue_clear(void);
/* fills two existing arrays with the geometry data of a circle */
/* the size of indices must be at least 3 times the number of vertices */
void create_circle_geometry(Vec2 position,
Color color,
float radius,
size_t num_vertices,
SDL_Vertex **vertices_out,
int **indices_out);
SDL_Vertex vertices[],
int indices[]);
struct SpriteBatch {
size_t size; /* how many primitives are in current batch */