FTTextureGlyph Class Reference

#include <FTTextureGlyph.h>

Inheritance diagram for FTTextureGlyph:

FTGlyph FTGlyph List of all members.

Public Member Functions

 FTTextureGlyph (FT_GlyphSlot glyph, int id, int xOffset, int yOffset, GLsizei width, GLsizei height)
virtual ~FTTextureGlyph ()
virtual const FTPointRender (const FTPoint &pen)
 FTTextureGlyph (FT_GlyphSlot glyph, int id, int xOffset, int yOffset, GLsizei width, GLsizei height)
virtual ~FTTextureGlyph ()
virtual const FTPointRender (const FTPoint &pen)

Static Public Member Functions

static void ResetActiveTexture ()
static void ResetActiveTexture ()

Private Attributes

int destWidth
int destHeight
FTPoint pos
FTPoint uv [2]
int glTextureID

Static Private Attributes

static GLint activeTextureID

Detailed Description

FTTextureGlyph is a specialisation of FTGlyph for creating texture glyphs.

See also:
FTGlyphContainer

Definition at line 20 of file FTTextureGlyph.h.


Constructor & Destructor Documentation

FTTextureGlyph::FTTextureGlyph ( FT_GlyphSlot  glyph,
int  id,
int  xOffset,
int  yOffset,
GLsizei  width,
GLsizei  height 
)

Constructor

Parameters:
glyph The Freetype glyph to be processed
id The id of the texture that this glyph will be drawn in
xOffset The x offset into the parent texture to draw this glyph
yOffset The y offset into the parent texture to draw this glyph
width The width of the parent texture
height The height (number of rows) of the parent texture

Definition at line 5 of file FTTextureGlyph.cxx.

References FT_GlyphSlotRec_::bitmap, FT_GlyphSlotRec_::bitmap_left, FT_GlyphSlotRec_::bitmap_top, FT_Bitmap_::buffer, destHeight, destWidth, FTGlyph::err, FT_GlyphSlotRec_::format, ft_glyph_format_bitmap, FT_Render_Glyph(), FT_RENDER_MODE_NORMAL, GL_ALPHA, GL_CLIENT_PIXEL_STORE_BIT, GL_FALSE, GL_TEXTURE_2D, GL_UNPACK_ALIGNMENT, GL_UNPACK_LSB_FIRST, GL_UNPACK_ROW_LENGTH, GL_UNSIGNED_BYTE, glBindTexture(), glPixelStorei(), glPopClientAttrib(), glPushClientAttrib(), glTexSubImage2D(), glTextureID, pos, FT_Bitmap_::rows, uv, FT_Bitmap_::width, FTPoint::X(), and FTPoint::Y().

FTTextureGlyph::~FTTextureGlyph (  )  [virtual]

Destructor

Definition at line 54 of file FTTextureGlyph.cxx.

FTTextureGlyph::FTTextureGlyph ( FT_GlyphSlot  glyph,
int  id,
int  xOffset,
int  yOffset,
GLsizei  width,
GLsizei  height 
)

Constructor

Parameters:
glyph The Freetype glyph to be processed
id The id of the texture that this glyph will be drawn in
xOffset The x offset into the parent texture to draw this glyph
yOffset The y offset into the parent texture to draw this glyph
width The width of the parent texture
height The height (number of rows) of the parent texture

virtual FTTextureGlyph::~FTTextureGlyph (  )  [virtual]

Destructor


Member Function Documentation

const FTPoint & FTTextureGlyph::Render ( const FTPoint pen  )  [virtual]

Renders this glyph at the current pen position.

Parameters:
pen The current pen position.
Returns:
The advance distance for this glyph.

Implements FTGlyph.

Definition at line 58 of file FTTextureGlyph.cxx.

References activeTextureID, FTGlyph::advance, destHeight, destWidth, GL_QUADS, GL_TEXTURE_2D, glBegin(), glBindTexture(), glEnd(), glTexCoord2f(), glTextureID, glTranslatef(), glVertex2f(), pos, uv, FTPoint::X(), X, Y, and FTPoint::Y().

static void FTTextureGlyph::ResetActiveTexture (  )  [inline, static]

Reset the currently active texture to zero to get into a known state before drawing a string. This is to get round possible threading issues.

Definition at line 55 of file FTTextureGlyph.h.

Referenced by FTGLTextureFont::PreRender().

virtual const FTPoint& FTTextureGlyph::Render ( const FTPoint pen  )  [virtual]

Renders this glyph at the current pen position.

Parameters:
pen The current pen position.
Returns:
The advance distance for this glyph.

Implements FTGlyph.

static void FTTextureGlyph::ResetActiveTexture (  )  [inline, static]

Reset the currently active texture to zero to get into a known state before drawing a string. This is to get round possible threading issues.

Definition at line 55 of file FTTextureGlyph.h.


Member Data Documentation

int FTTextureGlyph::destWidth [private]

The width of the glyph 'image'

Definition at line 61 of file FTTextureGlyph.h.

Referenced by FTTextureGlyph(), and Render().

int FTTextureGlyph::destHeight [private]

The height of the glyph 'image'

Definition at line 66 of file FTTextureGlyph.h.

Referenced by FTTextureGlyph(), and Render().

FTPoint FTTextureGlyph::pos [private]

Vector from the pen position to the topleft corner of the pixmap

Definition at line 71 of file FTTextureGlyph.h.

Referenced by FTTextureGlyph(), and Render().

FTPoint FTTextureGlyph::uv [private]

The texture co-ords of this glyph within the texture.

Definition at line 76 of file FTTextureGlyph.h.

Referenced by FTTextureGlyph(), and Render().

int FTTextureGlyph::glTextureID [private]

The texture index that this glyph is contained in.

Definition at line 81 of file FTTextureGlyph.h.

Referenced by FTTextureGlyph(), and Render().

static GLint FTTextureGlyph::activeTextureID [static, private]

The texture index of the currently active texture

We keep track of the currently active texture to try to reduce the number of texture bind operations.

Definition at line 89 of file FTTextureGlyph.h.

Referenced by Render().


The documentation for this class was generated from the following files:
Generated on Tue Jul 5 16:25:33 2011 for ROOT_528-00b_version by  doxygen 1.5.1