Setting glutBitmapCharacter color?

Posted by colordot on Stack Overflow See other posts from Stack Overflow or by colordot
Published on 2010-04-16T20:49:30Z Indexed on 2010/04/16 20:53 UTC
Read the original article Hit count: 413

Filed under:
|
|
|

Just wondering if someone can help me track down my issue with the following code where the text color is not being set correctly (its just rendering whatever color is in the background)

void RenderText(int x, int y, const char *string)
{
int i, len;

glUseProgram(0);

glLoadIdentity();
glColor3f(1.0f, 1.0f, 1.0f);
glTranslatef(0.0f, 0.0f, -5.0f);
glRasterPos2i(x, y);

glDisable(GL_TEXTURE_2D);
for (i = 0, len = strlen(string); i < len; i++)
{
    glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int)string[i]);
}
glEnable(GL_TEXTURE_2D);
}

I've checked all the usual things (I think), disabling texturing, setting color before rasterPos'ing, etc Ive disabled shaders but Im still having issues

© Stack Overflow or respective owner

Related posts about opengl

Related posts about text