aboutsummaryrefslogtreecommitdiff
path: root/src/graphics/vertex_buffer.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-11-15 08:20:13 +0100
committerdec05eba <dec05eba@protonmail.com>2021-11-15 08:20:13 +0100
commita3c6774f211ee765f910df76837548bdadd4e959 (patch)
tree499b29166c04fa62cb946c7d395f8a5299c78fbf /src/graphics/vertex_buffer.c
parentc4f84e1969f4c856a5bf0352e99fcb73a4cf56cf (diff)
Add dynamic font atlas creation (not finished)
Diffstat (limited to 'src/graphics/vertex_buffer.c')
-rw-r--r--src/graphics/vertex_buffer.c4
1 files changed, 2 insertions, 2 deletions
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();
}