I want to create a HUD for a simple game i am developing and at the moment i have text on the screen but i am using glRasterPos2f, with an extended glPrint method.
Unfortunately raster positioning makes the text appear further appart when the camera is zoomed in and really close together when zoomed out.
Is there anyway to lock the text to the top right of the screen??
ps. I am using a third person camera that rotates and zomms in and out around a point.
//Hud view
// Switch to ortho mode
glMatrixMode (GL_PROJECTION); // Tell opengl that we are doing project matrix work
glLoadIdentity(); // Clear the matrix
glOrtho(-9.0, 9.0, -9.0, 9.0, 0.0, 30.0); // Setup an Ortho view
glMatrixMode(GL_MODELVIEW); // Tell opengl that we are doing model matrix work. (drawing)
glLoadIdentity(); // Clear the model matrix
So if i was to draw my own hud i would do something like this:
//Hud view
// Switch to ortho mode
glMatrixMode (GL_PROJECTION); // Tell opengl that we are doing project matrix work
glLoadIdentity(); // Clear the matrix
glOrtho(-9.0, 9.0, -9.0, 9.0, 0.0, 30.0); // Setup an Ortho view
glMatrixMode(GL_MODELVIEW); // Tell opengl that we are doing model matrix work. (drawing)
glLoadIdentity(); // Clear the model matrix