Commit a3fe0617 authored by Frédéric Larue's avatar Frédéric Larue

Minor modification in the renderText() function of GLViewer.

parent 91f87eb6
...@@ -1398,7 +1398,7 @@ void GLViewer::renderText( double x, double y, const QString &text, const QFont ...@@ -1398,7 +1398,7 @@ void GLViewer::renderText( double x, double y, const QString &text, const QFont
// Save OpenGL states. // Save OpenGL states.
GLint buffer; GLint buffer;
GLboolean blend, depthTest; GLboolean blend, depthTest, multisample;
GLint blendSrcRGB, blendSrcAlpha; GLint blendSrcRGB, blendSrcAlpha;
GLint blendDstRGB, blendDstAlpha; GLint blendDstRGB, blendDstAlpha;
GLint alignment; GLint alignment;
...@@ -1407,6 +1407,7 @@ void GLViewer::renderText( double x, double y, const QString &text, const QFont ...@@ -1407,6 +1407,7 @@ void GLViewer::renderText( double x, double y, const QString &text, const QFont
glGetIntegerv( GL_FRAMEBUFFER_BINDING, &buffer ); glGetIntegerv( GL_FRAMEBUFFER_BINDING, &buffer );
glGetBooleanv( GL_DEPTH_TEST, &depthTest ); glGetBooleanv( GL_DEPTH_TEST, &depthTest );
glGetBooleanv( GL_BLEND, &blend ); glGetBooleanv( GL_BLEND, &blend );
glGetBooleanv( GL_MULTISAMPLE, &multisample );
glGetIntegerv( GL_BLEND_SRC_RGB , &blendSrcRGB ); glGetIntegerv( GL_BLEND_SRC_RGB , &blendSrcRGB );
glGetIntegerv( GL_BLEND_SRC_ALPHA, &blendSrcAlpha ); glGetIntegerv( GL_BLEND_SRC_ALPHA, &blendSrcAlpha );
glGetIntegerv( GL_BLEND_DST_RGB , &blendDstRGB ); glGetIntegerv( GL_BLEND_DST_RGB , &blendDstRGB );
...@@ -1432,7 +1433,7 @@ void GLViewer::renderText( double x, double y, const QString &text, const QFont ...@@ -1432,7 +1433,7 @@ void GLViewer::renderText( double x, double y, const QString &text, const QFont
painter.begin( this ); painter.begin( this );
painter.setPen( fontColor ); painter.setPen( fontColor );
painter.setFont( font ); painter.setFont( font );
painter.setRenderHints( QPainter::Antialiasing | QPainter::TextAntialiasing ); //painter.setRenderHints( QPainter::Antialiasing | QPainter::TextAntialiasing );
for( auto &l : textLines ) for( auto &l : textLines )
{ {
if( align & Qt::AlignRight ) if( align & Qt::AlignRight )
...@@ -1451,6 +1452,7 @@ void GLViewer::renderText( double x, double y, const QString &text, const QFont ...@@ -1451,6 +1452,7 @@ void GLViewer::renderText( double x, double y, const QString &text, const QFont
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, buffer ); glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, buffer );
blend? glEnable( GL_BLEND ) : glDisable( GL_BLEND ); blend? glEnable( GL_BLEND ) : glDisable( GL_BLEND );
depthTest? glEnable( GL_DEPTH_TEST ) : glDisable( GL_DEPTH_TEST ); depthTest? glEnable( GL_DEPTH_TEST ) : glDisable( GL_DEPTH_TEST );
multisample? glEnable( GL_MULTISAMPLE ) : glDisable( GL_MULTISAMPLE );
glBlendFuncSeparateEXT( blendSrcRGB, blendDstRGB, blendSrcAlpha, blendDstAlpha ); glBlendFuncSeparateEXT( blendSrcRGB, blendDstRGB, blendSrcAlpha, blendDstAlpha );
glColor4fv( glColor ); 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