Sign in to follow this  
Schlagwerk

glPrint... yeah.

Recommended Posts

I'm making a 2D puzzle game where printing text to the screen is pretty crucial (score, level, what have you). When I call the glPrint function (taken from Lesson #13) it puts a black, translucent overlay on the whole screen except for the text, which shows up normally. Here's some of the code from my DrawGLScene() function:
int DrawGLScene(GLvoid)
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glLoadIdentity();
    glTranslatef(-8.0,-5.0,-15.0);
    
    glPushMatrix();
        glTranslatef(3.0,HEIGHT+2,0.0);
        glDisable(GL_LIGHTING);
            glPrint("(%i,%i)",selectiony,selectionx);
        glEnable(GL_LIGHTING);
    glPopMatrix();
    // Draw everything else...
}
I remember that I figured this out once before, but that code is long gone and I can't remember for the life of me how I did it. I skimmed through the redbook but I couldn't find anything that seemed relevant. :/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this