Commit 09343ea1 authored by Jan Möbius's avatar Jan Möbius

Merge branch 'fixBadPickingInit' into 'master'

fixed a problem with the lastDrawMode not being initialized when picking

Closes #1

See merge request !11
parents cead023a 3110f889
......@@ -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