Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

OGLFT::TranslucentTexture Class Reference

Render text as texture mapped translucent quads. More...

#include <OGLFT.h>

Inheritance diagram for OGLFT::TranslucentTexture::

OGLFT::Texture OGLFT::Face List of all members.

Public Methods

 TranslucentTexture (const char *filename, float point_size=12, FT_UInt resolution=100)
 TranslucentTexture (FT_Face face, float point_size=12, FT_UInt resolution=100)
 ~TranslucentTexture (void)

Detailed Description

Render text as texture mapped translucent quads.

texture_translucent_class.png
This style is similar to the Translucent raster style, except instead of using glDrawPixels to draw the raster image, the image is used as a texture map on a quad. If drawing is confined to the Z plane, then you will see no difference between this style and Translucent. However, because the quad is a 3D object, it can be transformed by the usual modeling operations; so, texture mapped glyphs can be rotated in the X and Y directions as well as Z direction. Also, if the viewing (or modeling) transformation has a non-unity scale or shear, the glyphs will also be scaled or sheared (unlike the raster styles). Also, there is no problem with clipping glyphs which lie off the screen; texture mapped quads are properly clipped to the screen boundary.

If this is not convincing enough, the performance of texture mapped glyphs is generally as good as or better than the equivalent raster style (especially with hardware texture acceleration). However, they do consume more memory space.

Note: you must call

 glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
before drawing in order for textured glyphs to be rendered properly. Additionally, you need to activate blending in order to achieve the translucent effect:
 glEnable( GL_BLEND );
 glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );


Constructor & Destructor Documentation

OGLFT::TranslucentTexture::TranslucentTexture ( const char * filename,
float point_size = 12,
FT_UInt resolution = 100 )
 

Parameters:
file   the filename which contains the font face.
point_size   the initial point size of the font to generate. A point is essentially 1/72th of an inch. Defaults to 12.
resolution   the pixel density of the display in dots per inch (DPI). Defaults to 100 DPI.

OGLFT::TranslucentTexture::TranslucentTexture ( FT_Face face,
float point_size = 12,
FT_UInt resolution = 100 )
 

Parameters:
face   open FreeType FT_Face.
point_size   the initial point size of the font to generate. A point is essentially 1/72th of an inch. Defaults to 12.
resolution   the pixel density of the display in dots per inch (DPI). Defaults to 100 DPI.

OGLFT::TranslucentTexture::~TranslucentTexture ( void )
 

The translucent texture destructor doesn't really do anything.


The documentation for this class was generated from the following files:
Generated at Fri Jul 12 10:47:16 2002 for OGLFT by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001