Well I am able to write the score of 100 to the screen but then I want to write a black number to the screen. Then I want to write the next highest score to the screen. Basically I am having a problem of blacking out the score so I can overwrite it. Well what it does now is it prints the score to the screen and then it overwrites it with the next highest score. I have almost solved this problem I just need someone to give me a hint.
void
drawBitmapText(char *string,float x,float y,float z)
{
char
*c;
glPushAttrib(
GL_CURRENT_BIT);
glColor3f(1.0f,1.0f,1.0f);
glRasterPos3f(
x, y,z);
for
(c=string; *c != '\0'; c++)
{
glutBitmapCharacter(
GLUT_BITMAP_TIMES_ROMAN_24, *c);
}
glPopAttrib();
}
void
drawBitmapText_clear(char *string,float x,float y,float z)
{
char
*c;
glPushAttrib(
GL_CURRENT_BIT);
glColor3f(0.0f,0.0f,0.0f);
glRasterPos3f(
x, y,z);
for
(c=string; *c != '\0'; c++)
{
glutBitmapCharacter(
GLUT_BITMAP_TIMES_ROMAN_24, *c);
}
glPopAttrib();
}
void
brick_collision()
{
GLint n=0;
if(bricks[2][4]==true)
{
n+=100;
str=itoa(n,buffer,10);
drawBitmapText_clear(str,0.0f,2.0f,0.0f);
drawBitmapText(str,0.0f,2.0f,0.0f);
}
if(bricks[2][3]==true)
{
n+=100;
str=itoa(n,buffer,10);
drawBitmapText_clear(str,0.0f,2.0f,0.0f);
drawBitmapText(str,0.0f,2.0f,0.0f);
}
if(bricks[2][2]==true)
{
n+=100;
str=itoa(n,buffer,10);
drawBitmapText_clear(str,0.0f,2.0f,0.0f);
drawBitmapText(str,0.0f,2.0f,0.0f);
}
if(bricks[2][1]==true)
{
n+=100;
str=itoa(n,buffer,10);
drawBitmapText_clear(str,0.0f,2.0f,0.0f);
drawBitmapText(str,0.0f,2.0f,0.0f);
}
if(bricks[2][0]==true)
{
n+=100;
str=itoa(n,buffer,10);
drawBitmapText_clear(str,0.0f,2.0f,0.0f);
drawBitmapText(str,0.0f,2.0f,0.0f);
}
thanks for all the help