From a0c2e5b97fc712a1c6c5bd248c13c54559c3bc68 Mon Sep 17 00:00:00 2001 From: mfranz Date: Wed, 30 Jul 2008 14:52:01 +0000 Subject: [PATCH] disable clip planes after use (Doesn't seem to make a difference, and is only a temporary measure, as it was planned to OSGify the HUD and put it in the scenegraph etc.) --- src/Instrumentation/HUD/HUD.cxx | 12 ++++++++++++ src/Instrumentation/HUD/HUD.hxx | 1 + src/Instrumentation/HUD/HUD_ladder.cxx | 4 +--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Instrumentation/HUD/HUD.cxx b/src/Instrumentation/HUD/HUD.cxx index cab15dee6..4a42d47ef 100644 --- a/src/Instrumentation/HUD/HUD.cxx +++ b/src/Instrumentation/HUD/HUD.cxx @@ -293,6 +293,8 @@ void HUD::common_draw() if ((*it)->isEnabled()) (*it)->draw(); + _clip_box->unset(); + if (isAntialiased()) { glDisable(GL_ALPHA_TEST); glDisable(GL_LINE_SMOOTH); @@ -636,3 +638,13 @@ void ClipBox::set() glEnable(GL_CLIP_PLANE3); } + +void ClipBox::unset() +{ + if (_active) { + glDisable(GL_CLIP_PLANE0); + glDisable(GL_CLIP_PLANE1); + glDisable(GL_CLIP_PLANE2); + glDisable(GL_CLIP_PLANE3); + } +} diff --git a/src/Instrumentation/HUD/HUD.hxx b/src/Instrumentation/HUD/HUD.hxx index ca40d1602..ba0b4d4b1 100644 --- a/src/Instrumentation/HUD/HUD.hxx +++ b/src/Instrumentation/HUD/HUD.hxx @@ -58,6 +58,7 @@ class ClipBox { public: ClipBox(const SGPropertyNode *, float xoffset = 0, float yoffset = 0); void set(); + void unset(); private: bool _active; diff --git a/src/Instrumentation/HUD/HUD_ladder.cxx b/src/Instrumentation/HUD/HUD_ladder.cxx index 6e274d26c..186ca79cf 100644 --- a/src/Instrumentation/HUD/HUD_ladder.cxx +++ b/src/Instrumentation/HUD/HUD_ladder.cxx @@ -559,9 +559,7 @@ void HUD::Ladder::draw(void) _locStippleLineList.draw(); glDisable(GL_LINE_STIPPLE); } - glDisable(GL_CLIP_PLANE0); - glDisable(GL_CLIP_PLANE1); - glDisable(GL_CLIP_PLANE2); + _clip_box->set(); glPopMatrix(); //*************************************************************