Hi;
I'm trying to write some code into my existing game project to write some text to the window.
I've modified the sample code to plug into project. The output function assigns element in the text string to an individual char in order to pass to the display function (subsequently output to the screen). It compiles, but I don't see any text written to the window. Does anyone know how I can fix this?
void output(GLfloat x, GLfloat y, char* text)
{
glPushMatrix();
glTranslatef(x, y, 0);
glScalef(1/152.38, 1/152.38, 1/152.38);
for( char* p = text; *p; p++)
{
glutStrokeCharacter(GLUT_STROKE_ROMAN, *p);
}
glPopMatrix();
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
Painter p;
game.draw(p);
//write text to screen
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
glLineWidth(2.0);
output(400,200,"hello");
glutSwapBuffers();
}