PDA

View Full Version : OpenGL/SDL font example



cragwolf
05-05-2005, 12:07 PM
I have written a small example which shows how to draw text in OpenGL using fonts that have been defined in a fontmap texture, which I tediously created with the GIMP, 5 different sizes. I know you can just zoom text to whatever size you want, but you retain better quality if you provide a range of font sizes in your fontmap and just render them 1:1. You can download it from here:

http://www.urbanaustralia.org/cragwolf/fontgl.tar.gz (1,200 KB, I went overboard with the planets :D )

I compile it with FPC v1.9.8 using the -Mobjfpc command line switch. Will probably require small changes to get it to work on other platforms and with Object Pascal compilers.