From a3c6774f211ee765f910df76837548bdadd4e959 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 15 Nov 2021 08:20:13 +0100 Subject: Add dynamic font atlas creation (not finished) --- src/graphics/vertex_buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/graphics/vertex_buffer.c') diff --git a/src/graphics/vertex_buffer.c b/src/graphics/vertex_buffer.c index 325665c..9d15d47 100644 --- a/src/graphics/vertex_buffer.c +++ b/src/graphics/vertex_buffer.c @@ -100,12 +100,12 @@ void mgl_vertex_buffer_draw(mgl_context *context, mgl_vertex_buffer *vertex_buff context->gl.glPushMatrix(); context->gl.glTranslatef(vertex_buffer->position.x, vertex_buffer->position.y, 0.0f); - context->gl.glBindTexture(GL_TEXTURE_2D, texture ? texture->id : 0); + mgl_texture_use(texture); 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); + mgl_texture_use(NULL); context->gl.glPopMatrix(); } -- cgit v1.2.3