Rectangles become black boxes after text is output with drawstring

Hello,

I am seeing the following behavior and wanted to know if anyone has any thoughts on where I might start looking for a solution or do I just live with the work around that I have found.

Any help would be greatly appreciated.

digitalhack

I am running a version Openframeworks based on 0.8.0 with a modified ofAppEGLWindow.cpp that incorporates support for the pcDuino via the framebuffer. I am using the ofGLProgrammableRenderer. When it starts Openframeworks reports that it is running with:

GL_RENDERER = Mali-400 MP
GL_VERSION = OpenGL ES 2.0
GL_VENDOR = ARM

When I put the following code in ofApp::draw() I get a red box and a blue box.

ofSetColor(255, 0, 0);
ofRect( 10, 20, 100, 100 );

ofSetColor(0, 0, 255);
ofRect( 200, 20, 100, 100 );

When I add the following drawstring I get a red box, text, and a black box rather than a blue box abd anything drawn after the text comes out as a black box.

ofSetColor(255, 0, 0);
ofRect( 10, 20, 100, 100 );

ofSetColor(0, 0, 0);
msgFont.drawString(message, 120, 70);

ofSetColor(0, 0, 255);
ofRect( 200, 20, 100, 100 );

When I add an ofEnableAlphaBlending() I get the red box, text and a blue box like I would expect.

ofSetColor(255, 0, 0);
ofRect( 10, 20, 100, 100 );

ofSetColor(0, 0, 0);
msgFont.drawString(message, 120, 70);
ofEnableAlphaBlending();

ofSetColor(0, 0, 255);
ofRect( 200, 20, 100, 100 );

what do you get when you draw the blue box before the text?
(1-red box, 2-blue box, 3-text)

Thanks, excellent point. It isn’t dependent on where the text is drawn but rather the order the routines are called.

If I put the drawstring statement first but don’t change the position of the text as controlled by the x,y passed to draw string I get black box, text, black box.

If I put the drawstring statement last, again not changing the position of the text I get red box, text, blue box.

If I put the drawstring statement first and update the x, y so the text prints last I get black box, black box text.

If I put the drawstring statement last with the updated x, y I get red box, blue box, text.

digitalhack