I am trying to print some debugging info (FPS, camera location and rotation, etc) in the lower left of the screen. I have set it up so that it works fine using glTranslate() and glRasterPos2f(), but if I try and resize the window, the text is no longer resting perfectly in the corner, and depending on how much I stretch out the window, it may appear in the middle of the screen, or it may start getting cut off. Is there any way to use glPrint() to print text that will be say, 10px from the left, and 10px to the right?
Here is the code I am using:
GLvoid glPrint(const char *fmt, ...){ // Custom GL "Print" Routine
char text[256]; // Holds Our String
va_list ap; // Pointer To List Of Arguments
va_start(ap, fmt); // Parses The String For Variables
vsprintf(text, fmt, ap); // And Converts Symbols To Actual Numbers
va_end(ap); // Results Are Stored In Text
glPushAttrib(GL_LIST_BIT); // Pushes The Display List Bits
glListBase(base - 32); // Sets The Base Character to 32
glCallLists(strlen(text), GL_UNSIGNED_BYTE, text); // Draws The Display List Text
glPopAttrib(); // Pops The Display List Bits
}
void GLOUT(float xLocation, float yLocation, float colorRed, float colorGreen, float colorBlue){
glDisable(GL_TEXTURE_2D);
glLoadIdentity();
glTranslatef(0,0,-.002);
glColor3f(colorRed,colorGreen,colorBlue);
glRasterPos2f(xLocation/10000, yLocation/10000);
glPopMatrix();
}

The trick with rendering HUDs or other overlay stuff, is to switch to a more convenient combination of viewport and projection for them.
You’re not forced to stick to one particular projection with OpenGL. Let me guess: You setup viewport and projection in the window’s resizing handler, right? Suggestion: Move that code to the drawing function, and (hopefully) have an epiphany doing so.