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 ...@@ -1109,6 +1109,12 @@ void VolumeMeshNodeT<VolumeMeshT>::getRenderObjects(IRenderer* _renderer, GLStat
template<class VolumeMeshT> template<class VolumeMeshT>
void VolumeMeshNodeT<VolumeMeshT>::pick(GLState& _state, PickTarget _target) { 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 // save state
bool clientStateEnabledVertexArray = GLState::isClientStateEnabled(GL_VERTEX_ARRAY); bool clientStateEnabledVertexArray = GLState::isClientStateEnabled(GL_VERTEX_ARRAY);
...@@ -1215,6 +1221,9 @@ void VolumeMeshNodeT<VolumeMeshT>::pick(GLState& _state, PickTarget _target) { ...@@ -1215,6 +1221,9 @@ void VolumeMeshNodeT<VolumeMeshT>::pick(GLState& _state, PickTarget _target) {
lastPickTarget_ = _target; lastPickTarget_ = _target;
if(drawModeOverride)
lastDrawMode_ = DrawModes::NONE;
// restore state // restore state
if (clientStateEnabledVertexArray) if (clientStateEnabledVertexArray)
GLState::enableClientState(GL_VERTEX_ARRAY); GLState::enableClientState(GL_VERTEX_ARRAY);
......
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