summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <[email protected]>2015-09-25 19:34:17 +0200
committerAleix Pol <[email protected]>2015-09-25 19:34:17 +0200
commit40487a4a0030e2042d893a918a36687d09425634 (patch)
treeb0a0318e75f3ab2ed4900bf0e2025818a162e33b
parent6d8de55258b7d14bd41efdeed97d1ea27852e00c (diff)
fix crash
-rw-r--r--analitzaplot/plotter3d_es.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/analitzaplot/plotter3d_es.cpp b/analitzaplot/plotter3d_es.cpp
index 4f9d238..f99086d 100644
--- a/analitzaplot/plotter3d_es.cpp
+++ b/analitzaplot/plotter3d_es.cpp
@@ -171,8 +171,8 @@ void Plotter3DES::drawPlots()
const int normalLocation = program.attributeLocation("normal");
drawAxes();
+ drawRefPlane();
program.enableAttributeArray(vertexLocation);
- program.enableAttributeArray(normalLocation);
for (int i = 0, c = m_model->rowCount(); i < c; ++i)
{
PlotItem *item = itemAt(i);
@@ -191,6 +191,7 @@ void Plotter3DES::drawPlots()
{
if(!m_itemGeometries.contains(item))
continue;
+ program.enableAttributeArray(normalLocation);
auto it = m_itemGeometries[item];
it.bind();
@@ -200,10 +201,10 @@ void Plotter3DES::drawPlots()
program.setAttributeBuffer(normalLocation, GL_DOUBLE, offsetNormal, 3);
glDrawElements(GL_TRIANGLES, surf->indexes().size(), GL_UNSIGNED_INT, surf->indexes().constData());
it.release();
+ program.disableAttributeArray(normalLocation);
}
}
program.disableAttributeArray(vertexLocation);
- program.disableAttributeArray(normalLocation);
program.release();
}