diff options
Diffstat (limited to 'src/datavisualization/engine/drawer.cpp')
-rw-r--r-- | src/datavisualization/engine/drawer.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/datavisualization/engine/drawer.cpp b/src/datavisualization/engine/drawer.cpp index 8a8df4fd..b8726840 100644 --- a/src/datavisualization/engine/drawer.cpp +++ b/src/datavisualization/engine/drawer.cpp @@ -22,6 +22,7 @@ #include "utils_p.h" #include "texturehelper_p.h" #include "abstract3drenderer_p.h" +#include "scatterpointbufferhelper_p.h" #include <QtGui/QMatrix4x4> #include <QtCore/qmath.h> @@ -205,6 +206,22 @@ void Drawer::drawPoint(ShaderHelper *shader) glDisableVertexAttribArray(shader->posAtt()); } +void Drawer::drawPoints(ShaderHelper *shader, ScatterPointBufferHelper *object) +{ + // 1st attribute buffer : vertices + glEnableVertexAttribArray(shader->posAtt()); + glBindBuffer(GL_ARRAY_BUFFER, object->pointBuf()); + glVertexAttribPointer(shader->posAtt(), 3, GL_FLOAT, GL_FALSE, 0, (void*)0); + + // Draw the points + glDrawArrays(GL_POINTS, 0, object->indexCount()); + + // Free buffers + glBindBuffer(GL_ARRAY_BUFFER, 0); + + glDisableVertexAttribArray(shader->posAtt()); +} + void Drawer::drawLine(ShaderHelper *shader) { // Draw a single line |