Hey.
I am pretty new to OpenGL and my question is probably not very smart but the few things I learn about OpenGL I want to learn right, thats why I am asking.
Have a look please and thanks for your time.
I was lookin at a Nehe-tutorial about Printing text on the screen from a *.TGA.
I was struggling to get it done in the same scene as my excisting 3D-quad but I finally came up with this…
(It prints text and draws 3D-objects.)
//Inside my Drawingfunction, called every
//frame
glViewport(0,0, ScreenWidth, ScreenHeight);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0f, ScreenWidth,ScreenHeight,0.0f,-1.0f,1.0f);
glMatrixMode(GL_MODELVIEW);
glPrint(50,16,1,“Some Text”);//Reset all the stuff
glViewport(0,0, ScreenWidth, ScreenHeight);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.0f,(GLfloat)ScreenWidth/(GLfloat)ScreenHeight,0.1f,100.0f);glMatrixMode(GL_MODELVIEW);
glLoadIdentity();//Draw whatever 3D-Opbejcts.
I don’t know anything about those Matrix-settings as I basically put together chunks of code, ripped from some tutorials.
It works, I am not so sure though if it is (even relatively) fast way of drawing, with all those strange calls.
What do you think?
Advice is very appreciated.
Thanks for your time.
[This message has been edited by B_old (edited 10-14-2002).]