View Full Version : Best method to write text/GUI
12-07-2011, 12:36 PM
Hi everyone, I have to create a simple start menu with few buttons (star, quit, etc..).
Which is the best way to write text using OpenGL? Using glutBitmapCharacter, using Texture or some other libraries (FreeType for example)?
I wrote a simple code to draw buttons (QUADS) with text centered inside of them and I use glutBitmapCharacter. The problem is that size of font is too small.
12-07-2011, 12:58 PM
If I remember well, you can choose different font sizes with glut (up to 32 pixels high I think).
To answer your question, it depends. If you want to use gl 3.x and above only, then forget about glutBitmap, wgl fonts and such. They are deprecated since they use display lists. In this case, the easiest thing is certainly to draw your own images and use them as textures.
If you stay with gl 2.x (or even below), then glutBitmap and better wgl fonts (or their X11 variants), since they allow more configurations, like choosing the font, the size (...) are certainly the easiest option. You can check them here:
Nevertheless, the main advantage to use textures over bitmaps, is that you can change the button sizes easily, if you use mipmapping, then the quality of the display text should remain good. However this implies more work on your own (create all letters or all 'sentances' for example).
12-08-2011, 07:44 AM
I use OpenGL 2, I'm not a good "artist", so I think I'll use glutBitmap or FreeType library.
Thank you for your answer.
How can I modify font size of glutBitmap? I use the "biggest" *font but characters are too small for my program.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.