OpenGL ES SDK for Android
ARM Developer Center
|
Functions for drawing text in OpenGL ES. More...
#include <Text.h>
Public Member Functions | |
Text (const char *resourceDirectory, int windowWidth, int windowHeight) | |
Constructor for Text. More... | |
Text (void) | |
Overloaded default constructor. More... | |
~Text (void) | |
Overloaded default destructor. More... | |
void | clear (void) |
Removes the current string from the class. More... | |
void | addString (int xPosition, int yPosition, const char *string, int red, int green, int blue, int alpha) |
Add a std::string to be drawn to the screen. More... | |
void | draw (void) |
Draw the text to the screen. More... | |
Text (const char *resourceDirectory, int windowWidth, int windowHeight) | |
Constructor for Text. More... | |
Text (void) | |
Overloaded default constructor. More... | |
~Text (void) | |
Overloaded default destructor. More... | |
void | clear (void) |
Removes the current string from the class. More... | |
void | addString (int xPosition, int yPosition, const char *string, int red, int green, int blue, int alpha) |
Add a std::string to be drawn to the screen. More... | |
void | draw (void) |
Draw the text to the screen. More... | |
Text (const char *resourceDirectory, int windowWidth, int windowHeight) | |
Constructor for Text. More... | |
Text (void) | |
Overloaded default constructor. More... | |
~Text (void) | |
Overloaded default destructor. More... | |
void | clear (void) |
Removes the current string from the class. More... | |
void | addString (int xPosition, int yPosition, const char *string, int red, int green, int blue, int alpha) |
Add a std::string to be drawn to the screen. More... | |
void | draw (void) |
Draw the text to the screen. More... | |
Static Public Attributes | |
static const int | textureCharacterWidth = 8 |
The width (in pixels) of the characters in the text texture. More... | |
static const int | textureCharacterHeight = 16 |
The height (in pixels) of the characters in the text texture. More... | |
Static Private Attributes | |
static const char | textureFilename [] = "font.raw" |
static const char | vertexShaderFilename [] |
static const char | fragmentShaderFilename [] |
static const float | scale = 1.0f |
Scaling factor to use when rendering the text. More... | |
Functions for drawing text in OpenGL ES.
Uses a texture with images of alphanumeric and punctuation symbols. The class converts strings into texture coordinates in order to render the correct symbol from the texture for each character of the string.
Constructor for Text.
[in] | resourceDirectory | Path to the resources. Where the textures and shaders are located. |
[in] | windowWidth | The width of the window (in pixles) that the text is being used in. |
[in] | windowHeight | The height of the window (in pixles) that the text is being used in. |
AstcTextures::Text::Text | ( | void | ) |
AstcTextures::Text::~Text | ( | void | ) |
Constructor for Text.
[in] | resourceDirectory | Path to the resources. Where the textures and shaders are located. |
[in] | windowWidth | The width of the window (in pixles) that the text is being used in. |
[in] | windowHeight | The height of the window (in pixles) that the text is being used in. |
AstcTextures::Text::Text | ( | void | ) |
Overloaded default constructor.
AstcTextures::Text::~Text | ( | void | ) |
Overloaded default destructor.
Constructor for Text.
[in] | resourceDirectory | Path to the resources. Where the textures and shaders are located. |
[in] | windowWidth | The width of the window (in pixles) that the text is being used in. |
[in] | windowHeight | The height of the window (in pixles) that the text is being used in. |
AstcTextures::Text::Text | ( | void | ) |
Overloaded default constructor.
AstcTextures::Text::~Text | ( | void | ) |
Overloaded default destructor.
void AstcTextures::Text::addString | ( | int | xPosition, |
int | yPosition, | ||
const char * | string, | ||
int | red, | ||
int | green, | ||
int | blue, | ||
int | alpha | ||
) |
Add a std::string to be drawn to the screen.
[in] | xPosition | The X position (in pixels) to start drawing the text. Measured from the left of the screen. |
[in] | yPosition | The Y position (in pixels) to start drawing the text. Measured from the bottom of the screen. |
[in] | string | The string to be rendered on the screen. |
[in] | red | The red component of the text colour (accepts values 0-255). |
[in] | green | The green component of the text colour (accepts values 0-255). |
[in] | blue | The blue component of the text colour (accepts values 0-255). |
[in] | alpha | The alpha component of the text colour (accepts values 0-255). Affects the transparency of the text. |
void AstcTextures::Text::addString | ( | int | xPosition, |
int | yPosition, | ||
const char * | string, | ||
int | red, | ||
int | green, | ||
int | blue, | ||
int | alpha | ||
) |
Add a std::string to be drawn to the screen.
[in] | xPosition | The X position (in pixels) to start drawing the text. Measured from the left of the screen. |
[in] | yPosition | The Y position (in pixels) to start drawing the text. Measured from the bottom of the screen. |
[in] | string | The string to be rendered on the screen. |
[in] | red | The red component of the text colour (accepts values 0-255). |
[in] | green | The green component of the text colour (accepts values 0-255). |
[in] | blue | The blue component of the text colour (accepts values 0-255). |
[in] | alpha | The alpha component of the text colour (accepts values 0-255). Affects the transparency of the text. |
void AstcTextures::Text::addString | ( | int | xPosition, |
int | yPosition, | ||
const char * | string, | ||
int | red, | ||
int | green, | ||
int | blue, | ||
int | alpha | ||
) |
Add a std::string to be drawn to the screen.
[in] | xPosition | The X position (in pixels) to start drawing the text. Measured from the left of the screen. |
[in] | yPosition | The Y position (in pixels) to start drawing the text. Measured from the bottom of the screen. |
[in] | string | The string to be rendered on the screen. |
[in] | red | The red component of the text colour (accepts values 0-255). |
[in] | green | The green component of the text colour (accepts values 0-255). |
[in] | blue | The blue component of the text colour (accepts values 0-255). |
[in] | alpha | The alpha component of the text colour (accepts values 0-255). Affects the transparency of the text. |
Removes the current string from the class.
Should be called before adding a new string to render using addString().
Removes the current string from the class.
Should be called before adding a new string to render using addString().
Removes the current string from the class.
Should be called before adding a new string to render using addString().
Draw the text to the screen.
Should be called each time through the render loop so that the text is drawn every frame.
Draw the text to the screen.
Should be called each time through the render loop so that the text is drawn every frame.
|
staticprivate |
|
staticprivate |
|
static |
|
static |
|
staticprivate |
|
staticprivate |