From 5476dd7d21875d68a4d957f441d34eee2a9e2b37 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 29 Oct 2021 13:58:14 +0200 Subject: Fix multiple vertex buffers using the same data Need to call glVertexPointer/glTexCoordPointer/glColorPointer every time we render. --- src/graphics/vertex_buffer.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/graphics') diff --git a/src/graphics/vertex_buffer.c b/src/graphics/vertex_buffer.c index aa4fdbb..9203d63 100644 --- a/src/graphics/vertex_buffer.c +++ b/src/graphics/vertex_buffer.c @@ -104,6 +104,7 @@ void mgl_vertex_buffer_draw(mgl_context *context, mgl_vertex_buffer *vertex_buff context->gl.glBindTexture(GL_TEXTURE_2D, texture ? texture->id : 0); context->gl.glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer->id); + mgl_vertex_buffer_set_gl_buffer_pointers(context); context->gl.glDrawArrays(mgl_primitive_type_to_gl_mode(vertex_buffer->primitive_type), 0, vertex_buffer->vertex_count); context->gl.glBindBuffer(GL_ARRAY_BUFFER, 0); context->gl.glBindTexture(GL_TEXTURE_2D, 0); -- cgit v1.2.3