tags:

views:

37

answers:

0

Hi, 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? Any help is appreciated.

Edit: This problem only happens when the window is run in Fullscreen, by ChangeDisplaySettings. Any reason why this would be??