Unofficial OpenGL Software Development Kit
0.5.0
|
#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... | |
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:
This represents a counter-clockwise winding order (the OpenGL default), and is suitable for a triangle strip.
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.