partial implementation of double buffered render

This commit is contained in:
2024-10-15 15:29:45 +03:00
parent 446402c2e0
commit 139394c6de
10 changed files with 294 additions and 96 deletions

View File

@ -72,9 +72,7 @@ void render_rect_batch(const Primitive2D primitives[],
SDL_assert(primitives[0].type == PRIMITIVE_2D_RECT);
/* single vertex array is used for every batch with NULL glBufferData() trick at the end */
static VertexBuffer vertex_array = 0;
if (vertex_array == 0)
vertex_array = create_vertex_buffer();
VertexBuffer const vertex_array = get_scratch_vertex_array();
use_texture_mode(batch.mode);