Commit 157d6dbf authored by Martin Schultz's avatar Martin Schultz
Browse files

added qtbaseviewerpicking from qopengl branch

parent cc3912fb
...@@ -171,13 +171,18 @@ int glViewer::pickColor( ACG::SceneGraph::PickTarget _pickTarget, ...@@ -171,13 +171,18 @@ int glViewer::pickColor( ACG::SceneGraph::PickTarget _pickTarget,
glViewport (l, b, w, h); glViewport (l, b, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glMultMatrixd(projection.get_raw_data()); if (properties_.glState().compatibilityProfile())
glMatrixMode(GL_MODELVIEW); {
glLoadMatrixd(modelview.get_raw_data()); glMatrixMode(GL_PROJECTION);
ACG::GLState::disable(GL_LIGHTING); glLoadIdentity();
glMultMatrixd(projection.get_raw_data());
glMatrixMode(GL_MODELVIEW);
glLoadMatrixd(modelview.get_raw_data());
ACG::GLState::disable(GL_LIGHTING);
}
ACG::GLState::disable(GL_BLEND); ACG::GLState::disable(GL_BLEND);
ACG::GLState::enable(GL_DEPTH_TEST); ACG::GLState::enable(GL_DEPTH_TEST);
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
...@@ -188,11 +193,14 @@ int glViewer::pickColor( ACG::SceneGraph::PickTarget _pickTarget, ...@@ -188,11 +193,14 @@ int glViewer::pickColor( ACG::SceneGraph::PickTarget _pickTarget,
ACG::SceneGraph::traverse_multipass(sceneGraphRoot_, action,properties_.glState() ); ACG::SceneGraph::traverse_multipass(sceneGraphRoot_, action,properties_.glState() );
// restore GL state // restore GL state
glMatrixMode( GL_PROJECTION ); if (properties_.glState().compatibilityProfile())
glLoadMatrixd(projection.get_raw_data()); {
glMatrixMode( GL_MODELVIEW ); glMatrixMode(GL_PROJECTION);
glLoadMatrixd(modelview.get_raw_data()); glLoadMatrixd(projection.get_raw_data());
ACG::GLState::enable(GL_LIGHTING); glMatrixMode(GL_MODELVIEW);
glLoadMatrixd(modelview.get_raw_data());
ACG::GLState::enable(GL_LIGHTING);
}
properties_.glState().set_clear_color (clear_color); properties_.glState().set_clear_color (clear_color);
......
Supports Markdown
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