Sunday, October 23, 2005

Rendering text with FreeType and OpenGL

The port of the UI to OpenGL is almost complete. I have finished implementing the last major missing component, text rendering. Text is now drawn by calling FreeType directly; there is no SDL_ttf dependency any more. Each glyph is rendered to a display list that first draws a textured quad, and then translates the origin by the width of the glyph. This allows a string to be drawn simply by calling each glyph's display list in turn. Here is a screenshot:

No comments: