aboutsummaryrefslogtreecommitdiff
path: root/src/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/vertex_buffer.c10
1 files changed, 5 insertions, 5 deletions
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);