c - OpenGL - Add text without using GLUT -


i want add characters (x/y/z.., not strings) window using opengl, without using glut. know glutbitmapstring(), want avoid glut. suggestions...?

last time did retro-style game, created bitmap font , wrote small routine draw quad specific character texture on it. option draw every pixel of bitmap font in seperate quad.

you can find example code here:

http://svn.berlios.de/wsvn/pong2/trunk/src/interface.h http://svn.berlios.de/wsvn/pong2/trunk/src/interface.cpp

more specifically:

  • void interface::createfont() initiates bitmap font display list each character
  • void interface::drawtext(const std::string& text) lets opengl call display lists according string's characters

in specific example, wanted textured "pixels" within characters, each bitmap entry results in own quad stock texture on it. display lists nowadays less favored newer opengl features fbos , vbos replace functionality. don't know if @ point display lists got deprecated well.

the text in createfont() created gimp (http://www.gimp.org) export functionality.

screenshot celebrate 20k: screenshot of retro text rendering


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -