From: ehofman Date: Sat, 16 Aug 2003 11:35:04 +0000 (+0000) Subject: Disable depth buffer writes for 2D insturments. This should prevent z-buffer fighting X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=830ce9108c129712d8a4bcbfad74ce7cb5cfdff3;p=flightgear.git Disable depth buffer writes for 2D insturments. This should prevent z-buffer fighting --- 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(); }