From 37f9432feed87226bd0f576e16a263be5fb3ebac Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 17 Dec 2018 19:05:51 +0100 Subject: Fix glDrawArray call --- src/buffer/vertex/particle_vertex_buffer.cc | 4 ++-- src/buffer/vertex/texture_display_vertex_buffer.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/buffer/vertex') diff --git a/src/buffer/vertex/particle_vertex_buffer.cc b/src/buffer/vertex/particle_vertex_buffer.cc index fc61cc5..3f755dc 100644 --- a/src/buffer/vertex/particle_vertex_buffer.cc +++ b/src/buffer/vertex/particle_vertex_buffer.cc @@ -11,7 +11,7 @@ ParticleVertexBuffer::ParticleVertexBuffer(std::vector&& data): GL_ARRAY_BUFFER, _data.size() * sizeof(GLfloat), _data.data(), - GL_STATIC_DRAW + GL_DYNAMIC_DRAW ); glEnableVertexAttribArray(0); @@ -29,5 +29,5 @@ GLuint ParticleVertexBuffer::getBuffer() const { void ParticleVertexBuffer::draw() const { glBindVertexArray(_array); - glDrawArrays(GL_POINTS, 0, 3*_data.size()); + glDrawArrays(GL_POINTS, 0, _data.size()/3); } diff --git a/src/buffer/vertex/texture_display_vertex_buffer.cc b/src/buffer/vertex/texture_display_vertex_buffer.cc index 005ea76..d7efc73 100644 --- a/src/buffer/vertex/texture_display_vertex_buffer.cc +++ b/src/buffer/vertex/texture_display_vertex_buffer.cc @@ -19,7 +19,7 @@ TextureDisplayVertexBuffer::TextureDisplayVertexBuffer(): GL_ARRAY_BUFFER, _data.size() * sizeof(GLfloat), _data.data(), - GL_STATIC_DRAW + GL_DYNAMIC_DRAW ); glEnableVertexAttribArray(0); -- cgit v1.2.3