View Full Version : Replace GDI TextOut with OpenGL

04-18-2007, 04:37 PM
Could anyone please pointer me how to replace TextOut with OpenGL in 2D, I want to change the font name, font height, font orientation, also the Text ouput change with scale.


Joseph Steel
04-19-2007, 12:41 AM
Have a look at http://nehe.gamedev.net/lesson.asp?index=03 to start with.

04-19-2007, 11:22 AM
Thanks for your reply. I did try both Bitmap Font and Outline Font, the Bitmap font can not scale with windows, and the Outline Font seems a little slow compared with GDI TextOut and Bitmap Font, any other better way to do this? I mean almost the same function like GDI TextOut function.


04-19-2007, 12:46 PM
Does GDI textout scale with scale?

Use Bitmapfonts but create a new set when the windowsize changes ( it shouldnt change that often)

04-19-2007, 07:01 PM
Yes, TextOut does not scale with scale, the font size need to be calculated.

But I can not get the Bitmapfonts rotate, the CreateFont(..) does not work, could anyone help to rotate Bitmapfonts ?


04-20-2007, 03:30 AM
For arbitrary rotation and simple scaling of fonts, use font textures and render textured quads.
Here's an official GLUT example: http://www.opengl.org/resources/code/samples/glut_examples/texfont/texfont.html

There are font libraries using OpenGL on the web as well, GLTT, FTGL, etc. (not used myself though).