Search code examples
c++openglglutglew

Display simple text on vertices


So I am trying to make a simple program (I'm a student) and it works fine so far, but I can't figure out how to display the "i" value from the loop in the drawCircle() function in Shapes.cpp

code:

http://pastebin.com/4kDPNjy8

example: enter image description here

When I compile my code right now it looks like on the image to the left, but I want to get something like on the right but I have no idea how to do that kind of stuff or what function should I use for that.

Please help


Solution

  • glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, char(i));
    

    Should do it. But before that, you probably want to calculate position of each number, so do it, and then call:

    glRasterPos2f(X_pos, Y_pos);