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:
parent
7a3fe04275
commit
a0c2e5b97f
3 changed files with 14 additions and 3 deletions
|
@ -293,6 +293,8 @@ void HUD::common_draw()
|
||||||
if ((*it)->isEnabled())
|
if ((*it)->isEnabled())
|
||||||
(*it)->draw();
|
(*it)->draw();
|
||||||
|
|
||||||
|
_clip_box->unset();
|
||||||
|
|
||||||
if (isAntialiased()) {
|
if (isAntialiased()) {
|
||||||
glDisable(GL_ALPHA_TEST);
|
glDisable(GL_ALPHA_TEST);
|
||||||
glDisable(GL_LINE_SMOOTH);
|
glDisable(GL_LINE_SMOOTH);
|
||||||
|
@ -636,3 +638,13 @@ void ClipBox::set()
|
||||||
glEnable(GL_CLIP_PLANE3);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -58,6 +58,7 @@ class ClipBox {
|
||||||
public:
|
public:
|
||||||
ClipBox(const SGPropertyNode *, float xoffset = 0, float yoffset = 0);
|
ClipBox(const SGPropertyNode *, float xoffset = 0, float yoffset = 0);
|
||||||
void set();
|
void set();
|
||||||
|
void unset();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _active;
|
bool _active;
|
||||||
|
|
|
@ -559,9 +559,7 @@ void HUD::Ladder::draw(void)
|
||||||
_locStippleLineList.draw();
|
_locStippleLineList.draw();
|
||||||
glDisable(GL_LINE_STIPPLE);
|
glDisable(GL_LINE_STIPPLE);
|
||||||
}
|
}
|
||||||
glDisable(GL_CLIP_PLANE0);
|
_clip_box->set();
|
||||||
glDisable(GL_CLIP_PLANE1);
|
|
||||||
glDisable(GL_CLIP_PLANE2);
|
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
//*************************************************************
|
//*************************************************************
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue