MACnus
2004.11.12, 05:44 AM
I've use this code to write text in OpenGLView
glDisable(GL_DEPTH_TEST);
glPushMatrix();
glLoadIdentity(); //
glOrtho( 0, 10, 0, 10, -1.0, 1.0);
glMatrixMode( GL_MODELVIEW );
glPushMatrix();
glLoadIdentity();//
glColor4f(0,1,1, 0.7);
glPrint( font, 0.0, 0.0, "Score");
glPopMatrix();
glMatrixMode( GL_PROJECTION );
glPopMatrix();
glEnable(GL_DEPTH_TEST);
but the problems is that the text doesnt show up
if i delete both glLoadIdentity();, it shows up.
The problem then is that the text move around the camera.
What should I do?
glDisable(GL_DEPTH_TEST);
glPushMatrix();
glLoadIdentity(); //
glOrtho( 0, 10, 0, 10, -1.0, 1.0);
glMatrixMode( GL_MODELVIEW );
glPushMatrix();
glLoadIdentity();//
glColor4f(0,1,1, 0.7);
glPrint( font, 0.0, 0.0, "Score");
glPopMatrix();
glMatrixMode( GL_PROJECTION );
glPopMatrix();
glEnable(GL_DEPTH_TEST);
but the problems is that the text doesnt show up
if i delete both glLoadIdentity();, it shows up.
The problem then is that the text move around the camera.
What should I do?