Commit 2f58a5d0 authored by Jan Möbius's avatar Jan Möbius

Dennis:

Reset-clear-color-for-picking

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5395 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 1b7bbaf9
......@@ -925,6 +925,8 @@ void glViewer::paintGL()
if (!properties_.updateLocked())
{
ACG::Vec4f clear_color;
properties_.lockUpdate();
glPushAttrib (GL_ALL_ATTRIB_BITS);
......@@ -952,6 +954,12 @@ void glViewer::paintGL()
glColor4f(1.0,0.0,0.0,1.0);
if (properties_.renderPicking())
{
clear_color = properties_.glState().clear_color();
properties_.glState().set_clear_color (ACG::Vec4f (0.0, 0.0, 0.0, 1.0));
}
// clear (stereo mode clears buffers on its own)
if (!stereo_)
glstate_->clearBuffers ();
......@@ -967,6 +975,9 @@ void glViewer::paintGL()
glPopMatrix();
glPopAttrib ();
if (properties_.renderPicking())
properties_.glState().set_clear_color (clear_color);
}
}
......
......@@ -107,6 +107,9 @@ int glViewer::pickColor( ACG::SceneGraph::PickTarget _pickTarget,
const ACG::GLMatrixd& modelview = properties_.glState().modelview();
const ACG::GLMatrixd& projection = properties_.glState().projection();
ACG::Vec4f clear_color = properties_.glState().clear_color();
properties_.glState().set_clear_color (ACG::Vec4f (0.0, 0.0, 0.0, 0.0));
// prepare GL state
makeCurrent();
......@@ -133,6 +136,8 @@ int glViewer::pickColor( ACG::SceneGraph::PickTarget _pickTarget,
glLoadMatrixd(modelview.get_raw_data());
glEnable(GL_LIGHTING);
properties_.glState().set_clear_color (clear_color);
if (properties_.glState().pick_error ())
return -1;
......@@ -290,6 +295,9 @@ bool glViewer::pick_region( ACG::SceneGraph::PickTarget _pickTarg
const ACG::GLMatrixd& modelview = properties_.glState().modelview();
const ACG::GLMatrixd& projection = properties_.glState().projection();
ACG::Vec4f clear_color = properties_.glState().clear_color();
properties_.glState().set_clear_color (ACG::Vec4f (0.0, 0.0, 0.0, 0.0));
// prepare GL state
makeCurrent();
......@@ -316,6 +324,8 @@ bool glViewer::pick_region( ACG::SceneGraph::PickTarget _pickTarg
glLoadMatrixd(modelview.get_raw_data());
glEnable(GL_LIGHTING);
properties_.glState().set_clear_color (clear_color);
if (properties_.glState().pick_error ())
return false;
......
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