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. :/
glPrint... yeah.
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:
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement