Note that there are some explanatory texts on larger screens.

plurals
  1. POFTGL texture fonts display only black boxes when using multiple canvases
    primarykey
    data
    text
    <p>I am using texture fonts in FTGL to render fonts into multiple canvases as labels for axis and such. My first plot comes out fine. However all subsequent canvases render my texture fonts as simply black squares. I've also noticed that some numbers do not display on the canvas which actually renders. The "Center Time" should display 8.3956 but displays the following instead.</p> <p><img src="https://i.stack.imgur.com/VT9Ef.png" alt="enter image description here"></p> <p>The font rendering is as follows:</p> <pre><code> glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); PushGLMatrices(); GrSetPixelProjection(); glTranslatef(pixelX, pixelY, 0.0); glRotatef(ang, 0.0, 0.0, 1.0); savedFont-&gt;Render(label); PopGLMatrices(); </code></pre> <p>where </p> <pre><code> void PushGLMatrices() { glMatrixMode(GL_PROJECTION); glPushMatrix(); glMatrixMode(GL_MODELVIEW); glPushMatrix(); } void PopGLMatrices() { glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glPopMatrix(); } </code></pre> <p>I've tried a few things such as clearning color and depth bits, and glEnable(GL_TEXTURE_2D); glDisable(GL_DEPTH_TEST); but that didn't seem to help. For some reason, if I add FTTextureFont::FaceSize(int) into one of my routines which returns the width of the text, everything displays correctly (albeit slowly). From looking at the FTGL source code, it doesn't seem like FaceSize() would manipulate the openGL parameters except for a glDeleteTexture() call, so I'm a bit confused why this works. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload