For the entire night, I've been looking around the internet, both stackoverflow and elsewhere, to find something to say how to print text on GLUT. While I've found places that say how, none have explained it well, saying which parts of the function is neccessary, which parts aren't. I've also tried to copy in some of the code with the closest to a success is something that made my entire screen white except for some blue pixels. So I've given up, and I'm hoping this will clear up confusion for me and the many people who are confused, like me.
So, I have found this code:
glColor3f(1.0f, 0.0f, 0.0f); glRasterPos2f(1280, 720); int len = menu.length(); for (int i = 0; i < len; i++) { glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_10, menu[i]); } and I have placed it in my code:
void drawScene() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glRotatef(-_cameraAngle, 0.0f, 1.0f, 0.0f); glTranslatef(0.0f, 0.0f, -9.0f + zoom); glTranslatef(0.0f, -1.0f, 0.0f); string menu = "Hello!"; glColor3f(1.0f, 0.0f, 0.0f); glRasterPos2f(1280, 720); int len = menu.length(); for (int i = 0; i < len; i++) { glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_10, menu[i]); } /*if I need to post the rest of drawScene(), which is the function delegated as the Display Func, tell me. I don't want to because it's long What I want to know is what am I doing wrong, and what do future readers in my position need to do in order to get good results.