Login  Register

Re: Is this the correct way to draw rotated text with TextRenderer?

Posted by farrellf on Nov 22, 2016; 6:51pm
URL: https://forum.jogamp.org/Is-this-the-correct-way-to-draw-rotated-text-with-TextRenderer-tp4037443p4037444.html

Never mind, I just noticed the flush() method, that fixed it.

For anyone that runs across this thread in the future, you need to:

...
myTextRenderer.beginRendering(width, height);
gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glPushMatrix();
gl.glTranslatef(xOffset, yOffset, 0.0f);
gl.glRotatef(90.0f, 0.0f, 0.0f, 1.0f);
myTextRenderer.setColor(myColor);
myTextRenderer.draw(myText, 0, 0);
myTextRenderer.endRendering();
myTextRenderer.flush(); // <----- add this here
gl.glPopMatrix();
...

-Farrell