From 3489e8682089c71c42b30eca80d7230b2ecf44f8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 24 Oct 2021 08:05:50 +0200 Subject: Add clock --- src/graphics/vertex_buffer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/graphics/vertex_buffer.c') diff --git a/src/graphics/vertex_buffer.c b/src/graphics/vertex_buffer.c index ccdcd84..5a8e768 100644 --- a/src/graphics/vertex_buffer.c +++ b/src/graphics/vertex_buffer.c @@ -78,17 +78,17 @@ int mgl_vertex_buffer_update(mgl_vertex_buffer *self, const mgl_vertex *vertices } /* TODO: Optimize bind texture */ -void mgl_vertex_buffer_draw(mgl_context *context, mgl_vertex_buffer *self, const mgl_texture *texture) { - if(self->vertex_count == 0 || self->id == 0) +void mgl_vertex_buffer_draw(mgl_context *context, mgl_vertex_buffer *vertex_buffer, const mgl_texture *texture) { + if(vertex_buffer->vertex_count == 0 || vertex_buffer->id == 0) return; /* TODO: Optimize this */ context->gl.glPushMatrix(); - context->gl.glTranslatef(self->position.x, self->position.y, 0.0f); + context->gl.glTranslatef(vertex_buffer->position.x, vertex_buffer->position.y, 0.0f); context->gl.glBindTexture(GL_TEXTURE_2D, texture ? texture->id : 0); - context->gl.glBindBuffer(GL_ARRAY_BUFFER, self->id); - context->gl.glDrawArrays(mgl_primitive_type_to_gl_mode(self->primitive_type), 0, self->vertex_count); + context->gl.glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer->id); + 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