PDA

View Full Version : How to display character with opengl?



twins_online
03-20-2002, 04:46 PM
Is there any fuction?

zen
03-20-2002, 05:06 PM
Nope,OpenGL just renders primitves to the framebuffer.Not directly that is.If you take a look at the right side of the opengl.org page though you'll come across this link: http://www.opengl.org/developers/code/features/fontsurvey/index.html
You'll find all the information you need in there(propably more).

nexusone
03-20-2002, 06:10 PM
There are a few diffent ways to display charactors with opengl.

One is with GLUT and the function:
glutBitmapCharacter and glutStrokeCharacter

Aother is the use texture maped fonts,
examples of this at http://nehe.gamedev.net

Also you can draw characters, built from glprimitives.



Originally posted by twins_online:
Is there any fuction?

03-20-2002, 08:32 PM
There is a tutorial i remember looking through and the programmer wrote up a 'glPrintF("what ever you want to type");' function. http://www.opengl.org/discussion_boards/ubb/biggrin.gif

So i basically that function in my code.

Remember that the glPrintF function was defined in the tutorial and i just copy pasted. There is no glPrintF function in OpenGL it self.

None the less you could do the same from the nehe tutorials. Just figure out how the text is being draw (its not hard, but its a pain to keep coding for each project) and then do what the smart programmer did and rename it as a generic printf function you have in C which you can use afterwards for any code.

MPech
03-21-2002, 01:54 AM
If you like Quake 3 characters (and if you have the game) try :
http://www.gametutorials.com/Tutorials/OpenGL/OpenGL_Pg4.htm