Commit 3110f889 authored by Martin Schultz's avatar Martin Schultz

fixed a problem with the lastDrawMode not being initialized when picking

renderer is used at startup. fixes #1
parent cead023a
......@@ -1109,6 +1109,12 @@ void VolumeMeshNodeT<VolumeMeshT>::getRenderObjects(IRenderer* _renderer, GLStat
template<class VolumeMeshT>
void VolumeMeshNodeT<VolumeMeshT>::pick(GLState& _state, PickTarget _target) {
bool drawModeOverride = false;
if(lastDrawMode_ == DrawModes::NONE) // no last drawmode so the picking renderer
{ // is probably calling this function for rendering
lastDrawMode_ = drawMode();
drawModeOverride = true;
// save state
bool clientStateEnabledVertexArray = GLState::isClientStateEnabled(GL_VERTEX_ARRAY);
......@@ -1215,6 +1221,9 @@ void VolumeMeshNodeT<VolumeMeshT>::pick(GLState& _state, PickTarget _target) {
lastPickTarget_ = _target;
lastDrawMode_ = DrawModes::NONE;
// restore state
if (clientStateEnabledVertexArray)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment