I combined the code from the Windows and bitmapped font drawing routines into this:
glDisable ( GL_DEPTH_TEST );
glMatrixMode ( GL_PROJECTION );
glPushMatrix ( );
glLoadIdentity ( );
glOrtho ( g_rcScreen.left, g_rcScreen.right, g_rcScreen.bottom, g_rcScreen.top, -100, 100 );
glMatrixMode ( GL_MODELVIEW );
glPushMatrix ( );
glLoadIdentity ( );
glTranslated ( x, y, 0 );
glColor3f ( clr.r, clr.g, clr.b );
glPushAttrib ( GL_LIST_BIT );
glListBase ( g_fBase - 32 );
glCallLists ( strlen ( text ), GL_UNSIGNED_BYTE, text );
glPopAttrib ( );
glMatrixMode ( GL_PROJECTION );
glPopMatrix ( );
glMatrixMode ( GL_MODELVIEW );
glPopMatrix ( );
glEnable ( GL_DEPTH_TEST );
|
The g_rcScreen rect is (0,0)-(800,600). When I call this function and pass 0,0 as X and Y, the first time it draws the text at the -bottom- left corner. The second time, it draws to the bottom, centered (exactly to the right of where it finished drawing the first time). The third time, it draws exactly to the right of that, and by the fourth time the text is no longer visible on the screen. It would seem to be a problem with not calling LoadIdentity, but I am calling it.. and it still doesn't explain why it's drawing it on the bottom of the screen when I pass 0 for a y-coord. thanks for any help..
-RWarden (roberte@maui.net)
|