From 830ce9108c129712d8a4bcbfad74ce7cb5cfdff3 Mon Sep 17 00:00:00 2001 From: ehofman Date: Sat, 16 Aug 2003 11:35:04 +0000 Subject: [PATCH] Disable depth buffer writes for 2D insturments. This should prevent z-buffer fighting --- src/Cockpit/panel.cxx | 2 ++ src/Model/panelnode.cxx | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/Cockpit/panel.cxx b/src/Cockpit/panel.cxx index d59322318..4483dfa2a 100644 --- a/src/Cockpit/panel.cxx +++ b/src/Cockpit/panel.cxx @@ -346,7 +346,9 @@ FGPanel::update (GLfloat winx, GLfloat winw, GLfloat winy, GLfloat winh) glTranslated(x_offset, y_offset, 0); + glDepthMask(GL_FALSE); draw(); + glDepthMask(GL_TRUE); glMatrixMode(GL_PROJECTION); glPopMatrix(); diff --git a/src/Model/panelnode.cxx b/src/Model/panelnode.cxx index 55973b003..eedfed768 100644 --- a/src/Model/panelnode.cxx +++ b/src/Model/panelnode.cxx @@ -142,8 +142,12 @@ void FGPanelNode::draw_geometry() glGetFloatv(GL_PROJECTION_MATRIX, _lastProjection); glGetIntegerv(GL_VIEWPORT, _lastViewport); + glDepthMask( GL_FALSE ); + _panel->draw(); + glDepthMask( GL_TRUE ); + glPopMatrix(); }