aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-12-17 19:05:51 +0100
committerAdrian Kummerlaender2018-12-17 19:05:51 +0100
commit37f9432feed87226bd0f576e16a263be5fb3ebac (patch)
tree796b4a7831bd7ce9ecc223a2baf897325d21f1da /src
parenta82fb634384477fc4e60dc04fdbaec1cab0c54d5 (diff)
downloadcomputicle-37f9432feed87226bd0f576e16a263be5fb3ebac.tar
computicle-37f9432feed87226bd0f576e16a263be5fb3ebac.tar.gz
computicle-37f9432feed87226bd0f576e16a263be5fb3ebac.tar.bz2
computicle-37f9432feed87226bd0f576e16a263be5fb3ebac.tar.lz
computicle-37f9432feed87226bd0f576e16a263be5fb3ebac.tar.xz
computicle-37f9432feed87226bd0f576e16a263be5fb3ebac.tar.zst
computicle-37f9432feed87226bd0f576e16a263be5fb3ebac.zip
Fix glDrawArray call
Diffstat (limited to 'src')
-rw-r--r--src/buffer/vertex/particle_vertex_buffer.cc4
-rw-r--r--src/buffer/vertex/texture_display_vertex_buffer.cc2
2 files changed, 3 insertions, 3 deletions
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<GLfloat>&& 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);