aboutsummaryrefslogtreecommitdiff
path: root/src/graphics/vertex_buffer.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-10-24 08:05:50 +0200
committerdec05eba <dec05eba@protonmail.com>2021-10-26 11:09:20 +0200
commit3489e8682089c71c42b30eca80d7230b2ecf44f8 (patch)
tree2413cb5bec912ab8213d4dc22bb69ea4467bb737 /src/graphics/vertex_buffer.c
parent115630b520668304af1ccd3eb0b13c06e17ecccc (diff)
Add clock
Diffstat (limited to 'src/graphics/vertex_buffer.c')
-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);