glFont Still Going Strong
Posted in Game Development on Sat, September 27, 2008 at 11:57 AMAfter 10 years, glFont is still quite popular. Version 1 was released in 1998, and version 2 in 2002. Even though the latest release is over 6 years old, I still receive emails from users on a regular basis. This month alone has seen more than the average, including one from a commercial game studio wanting clarification on the license so they can start using it in their products.
Unfortunately, over the past 10 years, probably about half of the emails I receive are the "I have a bug in my program, can you fix it?" type, with source code attached. I find that a lot of people that attempt to start using glFont don't even have a basic knowledge of OpenGL. Most of the time the attached code is some random OpenGL boilerplate sample taken from somewhere on the web with some glFont calls thrown in. My consolation is the fact that glFont has been used in many commercial products and successful hobbyist projects.
To this day I have received not a single cent for glFont, which is fine. I think at one point I threw in a note that said "donations welcome" (I was a poor student at the time), but nobody seems to have taken me up on that. People wonder why I never charged for it, but I think that's obvious: it wouldn't have helped anyone that way. Getting frequent emails that say stuff like "Thanks for your wonderful tool!" etc., is satisfaction enough.
Now, if I'll ever get around to releasing version 3 that has been sitting on my hard drive since 2004...



4 comments:
It's got to feel good to have made something that's so useful/helpful, and it's pretty cool that BYU has kept up after all this time.
Yeah, I'm actually surprised my pages are still up. I don't even have login access anymore.
Hi everyone,
I have started using opengl 3 month ago and now i really need to draw text for an application i am designing. My friend talked me about GLfont and it's exactly what i am looking for... Trying two days to make it work, i have definitely give up. Here is my code... Could someone help me know its not working?
≠ include <windows.h>
≠ include <gl/gl.h>
≠ include <gl/glu.h>
≠ include <GL/glut.h>
≠ include <iostream>
≠ include <stdio.h>
≠ include "glfont.h"
GLuint textureName =1;
glGenTextures((GLsizei)1, &textureName);
PixelPerfectGLFont *myfont = new PixelPerfectGLFont();
void TestBedInit (void) {
//Initialize OpenGL glClearColor(1.0f, 1.0f, 1.0f, 0.0f); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); //Initialize the viewport glViewport(0, 0, 640, 480); //Initialize OpenGL projection matrix glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0f, 640.0f, 480.0f, 0.0f, -2.0f, 2.0f); //Try and load our font try { myfont->Create("me.glf", textureName); } catch(GLFontError::InvalidFile){ cerr << "Cannot load fontn";
abort(); }}
void TestBedRender (void) { //Draw some stuff
glMatrixMode(GL_MODELVIEW); glLoadIdentity( ); glEnable(GL_TEXTURE_2D); glColor3f(1.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT) ; try { myfont->Begin(); myfont->TextOut("hello world", 5, 5, 0); //myfont->End(); } catch(GLFontError::InvalidFont) {cerr << "Trying to draw with an uninitialized fontn";
abort(); } glDisable(GL_TEXTURE_2D); glLoadIdentity();}
void display(void) {
TestBedRender(); glutSwapBuffers() ;}
void handleResize(int w, int h) {
glViewport(0, 0, w, h); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0, (float)w / (float)h, 1.0, 200.0);}
int main(int argc, char argv) {
glutInit(&argc, argv) ; glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE) ; glutInitWindowSize(640, 480); glutCreateWindow(argv[0]) ; TestBedInit(); glutDisplayFunc(display) ; glutReshapeFunc(handleResize); glutMainLoop() ; //delete myfont;return 0 ;
}
Sorry it's me again... My email is futurchercheur1@gmail.com ... Thank you for your help