Unofficial OpenGL Software Development Kit  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
List of all members | Public Member Functions
glutil::GlyphQuad Class Reference

#include <Font.h>

Data type for a single glyph.

The data for a glyph, as far as the font system is concerned, is a set of positions that define the space of the quad, and a set of texture coordinates that reference the Font's texture. Both the positions and texture coordinates are 2D vectors.

Public Member Functions

 GlyphQuad (glm::vec2 ptBottomLeft, glm::vec2 tcBottomLeft, glm::vec2 ptTopRight, glm::vec2 tcTopRight)
 Creates a glyph given two corner positions and two corner texture coordinates.
 
std::vector< glm::vec2 > GetPositions () const
 Returns the positions of the glyph as an array, for easy usage. More...
 
std::vector< glm::vec2 > GetTexCoords () const
 Returns the texture coordinates of the glyph as an array, for easy usage. More...
 

Member Function Documentation

std::vector<glm::vec2> glutil::GlyphQuad::GetPositions ( ) const

Returns the positions of the glyph as an array, for easy usage.

The vector will have 4 elements, representing the four corners of the quad. In order, the points are:

  1. Top-left
  2. Bottom-left
  3. Top-right
  4. Bottom-right

This represents a counter-clockwise winding order (the OpenGL default), and is suitable for a triangle strip.

Todo:
Make this return a boost::array or something.
std::vector<glm::vec2> glutil::GlyphQuad::GetTexCoords ( ) const

Returns the texture coordinates of the glyph as an array, for easy usage.

The vector will have 4 elements, representing the four corners of the quad. They are in the same order as for GetPositions.

Todo:
Make this return a boost::array or something.

The documentation for this class was generated from the following file: