@@ -1892,17 +1892,16 @@ void ofGLProgrammableRenderer::drawString(string textString, float x, float y, f
18921892
18931893// ----------------------------------------------------------
18941894void ofGLProgrammableRenderer::drawString (const ofTrueTypeFont & font, string text, float x, float y) const {
1895- const_cast <ofGLProgrammableRenderer*>(this )->setAttributes (true ,true ,true ,false );
1895+ ofGLProgrammableRenderer * mutThis = const_cast <ofGLProgrammableRenderer*>(this );
1896+ mutThis->setAttributes (true ,true ,true ,false );
18961897 const ofTexture& tex = font.getFontTexture ();
18971898 ofBlendMode blendMode = currentStyle.blendingMode ;
18981899 if (tex.isAllocated ()) {
1899- const_cast <ofGLProgrammableRenderer*>(this )->setBlendMode (OF_BLENDMODE_ALPHA);
1900- const_cast <ofGLProgrammableRenderer*>(this )->bind (tex,0 );
1901- // draw(font.getStringMesh(text,x,y,isVFlipped()),OF_MESH_FILL);
1902- font.getStringMesh (text, x,y).draw ();
1903- // draw(font.getStringMesh(text,x,y),OF_MESH_FILL);
1904- const_cast <ofGLProgrammableRenderer*>(this )->unbind (tex,0 );
1905- const_cast <ofGLProgrammableRenderer*>(this )->setBlendMode (blendMode);
1900+ mutThis->setBlendMode (OF_BLENDMODE_ALPHA);
1901+ mutThis->bind (font.getFontTexture (),0 );
1902+ draw (font.getStringMesh (text,x,y,isVFlipped ()),OF_MESH_FILL);
1903+ mutThis->unbind (font.getFontTexture (),0 );
1904+ mutThis->setBlendMode (blendMode);
19061905 } else {
19071906 ofLogWarning (" ofGLProgrammableRenderer" ) << " draw(): texture is not allocated" ;
19081907 }
0 commit comments