Problem when using glutStrokeString instead of glutBitmapString
Question
I'm writing my first OpenGL-program (in C using freeglut). I have the following code in my display function, that works nicely and prints out a grey colored text:
glColor3f(0.5f, 0.5f, 0.5f);
glRasterPos2f(0, 0);
glutBitmapString(GLUT_BITMAP_HELVETICA_12, (unsigned char*)"some text");
Now I'd like to try glutStrokeString instead of glutBitmapString. In my (humble) understanding of the API, the following should work:
glScalef(0.003,0.003,1);
glutStrokeString(GLUT_STROKE_ROMAN, (unsigned char*)"some text");
Running my program with this two lines instead of the glutBitmapString-call shows the text once before it disappears. Moreover from that point on all my texts displayed with glutBitmapString don't work either. What am I missing here?
Solution
I've finally solved it. The problem was, that for some reason glutIdleFunc was set to my display-function and I forgot to reset my matrix (so I called glScalef again and again). It works fine now.