proper size of build_vertex_buffer for circle indices

This commit is contained in:
veclav talica 2024-10-18 18:45:17 +03:00
parent 7e409fc14a
commit b683594013

View File

@ -65,7 +65,7 @@ VertexBuffer get_circle_element_buffer(void) {
if (buffer == 0) { if (buffer == 0) {
buffer = create_vertex_buffer(); 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) { for (size_t i = 1; i < CIRCLE_VERTICES_MAX; ++i) {
/* first one is center point index, always zero */ /* first one is center point index, always zero */