Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I know this might be a very late reply but I came across this question looking for answers to this exact problem. The way I attempted to draw text over a polygon is slightly different. I have a method that looked like this:</p> <pre><code>glClear( GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT ); glLoadIdentity(); glRasterPos2f( pX, pY ); glPushAttrib( GL_LIST_BIT ); glListBase( base - 32 ); glCallLists( length( pText ), GL_UNSIGNED_BYTE, PChar( pText ) ); glPopAttrib(); </code></pre> <p>I tried drawing a polygon and text over it like this:</p> <pre><code>glPushMatrix(); glBegin(GL_QUADS); glColor( 1.0, 0.0, 0.0 ); glVertex2f( fX, fY ); glVertex2f( fX + fWidth, fY ); glVertex2f( fX + fWidth, fY + fHeight ); glVertex2f( fX, fY + fHeight ); glEnd( ); glColor( 0.0, 1.0, 0.0 ); Text( 100, 100, fCaption ); glPopMatrix(); </code></pre> <p>But, similar to your problem, only the text would draw or in some case (after moving the Text method around a bit) nothing would draw at all. I realized that the method had</p> <pre><code>glClear( GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT ); </code></pre> <p>which OBVIOUSLY cleared the buffer after I drew the polygon and before I drew the text... This was such a silly mistake and although I have failed to recognize any similar code in the code you have provided, it may be somewhere else. Either way this bit of code will help you if you just clear the <code>glClear</code> method from the <code>Text</code> method. Hope this helps or might help other people who are in a similar situation.</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.
    1. VO
      singulars
      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