OpenGL bitmap text fails after drawing polygon
Posted
by
kaykun
on Stack Overflow
See other posts from Stack Overflow
or by kaykun
Published on 2010-04-04T00:38:19Z
Indexed on
2012/06/27
15:16 UTC
Read the original article
Hit count: 432
I'm using Win32 and OpenGL to to draw text onto a window. I'm using the bitmap font method, with wglUseFontBitmaps
. Here is my main rendering function:
glClear(GL_COLOR_BUFFER_BIT);
glPushMatrix();
glColor3f(1.0f, 0.0f, 1.0f);
glBegin(GL_QUADS);
glVertex2f(0.0f, 0.0f);
glVertex2f(128.0f, 0.0f);
glVertex2f(128.0f, 128.0f);
glVertex2f(0.0f, 128.0f);
glEnd();
glPopMatrix();
glPushMatrix();
glColor3f(1.0f, 1.0f, 1.0f);
glRasterPos2i(200, 200);
glListBase(fontList);
glCallLists(5, GL_UNSIGNED_BYTE, "Test.");
glPopMatrix();
SwapBuffers(hDC);
As you can see it's very simple and the only thing that it's supposed to do is draw a quadrilateral and draw the text "Test.". But the problem is that drawing a polygon seems to mess up any text operations I try to do after it. If I place the text drawing functions before the polygon, both the text and the polygon draw fine. Is there something I'm missing here?
Edit: This problem only happens when the window is run in Fullscreen, by ChangeDisplaySettings
. Any reason why this would be??
© Stack Overflow or respective owner