How to write text on OpenGL?

How to write numbers or characters on the graphic?


Hi !

It depnds on your platform, glut has built in functionality to handle text, on windows you could use wglUseFontOutlines or wglUseFontBitmaps to create a displaylist of bitmap or outline/filled characters font a font.

If you want a more platform independent way there are a number of libraris based on freetype that can help you (do a search on

Mikael has a review of some methods under the “documentation” section and at the right of the main page if I am not wrong.