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... | |
virtual | ~Text (void) |
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 *vertexShaderFileName, const char *fragmentShaderFileName, const char *textureFileName, int windowWidth, int windowHeight) | |
Constructor for Text. More... | |
virtual | ~Text (void) |
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 text 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... | |
virtual | ~Text (void) |
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 std::string | textureFilename = "font.raw" |
static const std::string | vertexShaderFilename = "font.vert" |
static const std::string | fragmentShaderFilename = "font.frag" |
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. |
MaliSDK::Text::Text | ( | const char * | vertexShaderFileName, |
const char * | fragmentShaderFileName, | ||
const char * | textureFileName, | ||
int | windowWidth, | ||
int | windowHeight | ||
) |
Constructor for Text.
[in] | vertexShaderFileName | Name of a vertex shader file. |
[in] | fragmentShaderFileName | Name of a fragment shader file. |
[in] | textureFileName | Name of a font texture file. |
[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. |
|
virtual |
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. |
|
virtual |
Default destructor.
void MaliSDK::Text::addString | ( | int | xPosition, |
int | yPosition, | ||
const char * | string, | ||
int | red, | ||
int | green, | ||
int | blue, | ||
int | alpha | ||
) |
Add a text 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 MaliSDK::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 MaliSDK::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 |