1
0
Fork 0

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.)
This commit is contained in:
mfranz 2008-07-30 14:52:01 +00:00
parent 7a3fe04275
commit a0c2e5b97f
3 changed files with 14 additions and 3 deletions

View file

@ -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);
}
}

View file

@ -58,6 +58,7 @@ class ClipBox {
public:
ClipBox(const SGPropertyNode *, float xoffset = 0, float yoffset = 0);
void set();
void unset();
private:
bool _active;

View file

@ -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();
//*************************************************************