Font Class
This is a font class (Jan 2001) that enables you to write full 3D text in opengl easily. The screenshot shows an app I’ve made using the font class. As you can see it can display both wireframe and solid fonts. The solid fonts have correct normals and can therefore be lit properly. The class is windows-only as of now due to the fact that it uses wgl* functions, but it could be ported to GNU/Linux/macOS I beleive, send me a mail if you want to help. The class is easy to use, you create a CFont object and initialise it by sending your HDC and a style parameter which can be FONT_WIREFRAME for wireframe fonts and FONT_SOLID for solid fonts. Then you call the “Print()” member function of the object and the text is displayed, a destructor takes care of the cleaning up. See the header file here: Fontclass Header, as you can see the class is very simple, but that’s a choice from my side since I don’t need more advanced fonts yet. The basic font code is highly inspired by NeHe’s tutorial and the Print() function is almost identical to the one NeHe wrote. The font class can be downloaded here: Font Class (Jan 2001)
- No comments yet.
- No trackbacks yet.