From b683594013e9d4d66df7975f87cbe88c32438b2b Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Fri, 18 Oct 2024 18:45:17 +0300 Subject: [PATCH] proper size of build_vertex_buffer for circle indices --- src/rendering/twn_gl_any_rendering.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rendering/twn_gl_any_rendering.c b/src/rendering/twn_gl_any_rendering.c index c0510ab..9c30571 100644 --- a/src/rendering/twn_gl_any_rendering.c +++ b/src/rendering/twn_gl_any_rendering.c @@ -65,7 +65,7 @@ VertexBuffer get_circle_element_buffer(void) { if (buffer == 0) { buffer = create_vertex_buffer(); - VertexBufferBuilder builder = build_vertex_buffer(buffer, sizeof (GLshort) * CIRCLE_ELEMENT_BUFFER_LENGTH); + VertexBufferBuilder builder = build_vertex_buffer(buffer, sizeof (GLshort) * (CIRCLE_VERTICES_MAX - 1) * 3); for (size_t i = 1; i < CIRCLE_VERTICES_MAX; ++i) { /* first one is center point index, always zero */