How do I draw text with GLUT / OpenGL in C++?


How do I draw a text string onto the screen using GLUT / OpenGL drawing functions?

12/21/2017 8:11:27 PM

Accepted Answer

There are two ways to draw strings with GLUT

glutStrokeString will draw text in 3D

alt text

and glutBitmapString will draw text facing the user

alt text

7/13/2019 7:40:44 PM

If you don't like the built-in stroke font or bitmap font that comes with GLUT as per epatel's answer, you'll have to roll your own solution.

NeHe has some good tutorials (along with fully-working sample code) on this:

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow