View Full Version : Writing a text string

Bill Stanley
11-14-2004, 09:04 AM
I am trying to write a text string to the graphics
window. Using GLUT, I can write a string to the
non-graphics window but this is not very desirable.

I am usung Win-32 GLUT in my application. I have
not yet found any way to do this. How do I proceed?

Also, is there any way to control the size,
position or even the existance of the non-graphics
window. I realize that standars I/O is done via
this window. I am aware that the compiler can
control this behavior but is there any OpenGl or
GLUT way of doing this also?

11-14-2004, 10:37 PM
Hi !

All text support is explained in the glut manual.

You might also want to take a look at FreeType (this is a library to use TT fonts), there are add on libraries for this to make it possible to render TT fonts in OpenGL without any platform dependencies.

GLUT has no support for controling the text in the console window (which I assume you are talking about), this is up to the operating system.

You might want to try to play around with ansi escape character strings to control color of text in the console window, this works on many operating systems today.


Bill Stanley
11-15-2004, 09:40 AM
Thank you. I suspected that text strings were not
directly supported. You confirmed my conclusions.

As for controlling the console window. If I can
find a way to display text in the graphics window,
I am interested in resixing the default size of the
console window to make it much smaller. Ideally,
I want to eliminate it altogether. Since the
console window is under operating system control,
I will start to look there.

11-15-2004, 02:11 PM
Hi !

You do not need to have any console window, this all depends on how you link your application (console or win32), if you link it as a win32 application no console window will need to be created, but it will need a WinMain function.