View Full Version : how to draw text on the screen

10-09-2011, 09:36 AM
Dear Friends
how can I draw text on the screen in openGL...Please give me some suggestion how can I write 'Hello World' on the screen.
Not using any glut feature....Using openGL in VC++. Please give me some suggestions. Thanks Sujan

10-09-2011, 11:24 AM
Have you Googled this subject?
There are tutorials on using a font texture ( see HeNe website ) and many free 3rd party font rendering libraries.

10-10-2011, 09:35 AM
I've found drawing text in a graphics environment can be kind of a pain when you start. Once you create an openGL context the OS pretty much gives up and says your own your own here.

A common way is to use an atlas texture for your fonts. Here is one of many programs that can generate such a texture:

If you need multiple languages, I've heard good things about FreeType:
It can generate font textures on the fly in your code so you don't need megabytes of font maps.

If you just need something quick and dirty you can use wglUseFontBitmaps (Windows only). The downside for this is it's pretty slow to render, and the fonts are very aliased. A good option if you just need to throw FPS on the screen or something:

10-11-2011, 01:43 AM
There is an app for that