Commit 5f9be226 authored by Frédéric Larue's avatar Frédéric Larue

Depth test bug fixed in drawText() function of GLViewer.

parent 02e4d899
......@@ -1433,13 +1433,14 @@ void GLViewer::renderText( double x, double y, const QString &text, const QFont
// Save OpenGL states.
GLint buffer;
GLboolean blend;
GLboolean blend, depthTest;
GLint blendSrcRGB, blendSrcAlpha;
GLint blendDstRGB, blendDstAlpha;
GLint alignment;
GLfloat glColor[4];
glGetIntegerv( GL_FRAMEBUFFER_BINDING, &buffer );
glGetBooleanv( GL_DEPTH_TEST, &depthTest );
glGetBooleanv( GL_BLEND, &blend );
glGetIntegerv( GL_BLEND_SRC_RGB , &blendSrcRGB );
glGetIntegerv( GL_BLEND_SRC_ALPHA, &blendSrcAlpha );
......@@ -1484,7 +1485,8 @@ void GLViewer::renderText( double x, double y, const QString &text, const QFont
glPixelStorei( GL_UNPACK_ALIGNMENT, alignment );
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, buffer );
blend? glEnable( GL_BLEND ) : glDisable( GL_BLEND );
glBlendFuncSeparateEXT( blendSrcRGB, blendDstRGB, blendSrcAlpha, blendDstAlpha );
depthTest? glEnable( GL_DEPTH_TEST ) : glDisable( GL_DEPTH_TEST );
glBlendFuncSeparateEXT( blendSrcRGB, blendDstRGB, blendSrcAlpha, blendDstAlpha );
glColor4fv( glColor );
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment