Mali OpenGL ES SDK  2.0.0
A simple framework to aid development of OpenGL ES applications targeting ARM Mali platforms.
 All Classes Files Functions Variables Enumerations Enumerator
MaliSDK::Texture Class Reference

Functions for working with textures. More...

#include <Texture.h>

List of all members.

Static Public Member Functions

static bool isETCSupported (bool verbose=false)
 Reports whether or not ETC (Ericsson Texture Compression) is supported.
static void createTexture (unsigned int width, unsigned int height, GLvoid **textureData)
 Create a texture using random data.
static void createTexture (unsigned int width, unsigned int height, unsigned int red, GLvoid **textureData)
 Create a 1 component texture of uniform colour.
static void deleteTextureData (GLvoid **textureData)
 Deletes previously created texture.
static void loadData (const char *filename, unsigned char **textureData)
 Load texture data from a file into memory.
static void loadPKMData (const char *filename, ETCHeader *etcHeader, unsigned char **textureData)
 Load header and texture data from a pkm file into memory.
static void loadCompressedMipmaps (const char *filenameBase, const char *filenameSuffix, GLuint *textureID)
 Load compressed mipmaps into memory.

Static Private Member Functions

static void getCompressedTextureFormats (GLint **textureFormats, int *numberOfTextureFormats)
 Uses glGetIntegerv to get the number of compressed texture formats and the formats themselves.

Detailed Description

Functions for working with textures.


Member Function Documentation

void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
GLvoid **  textureData 
)
static

Create a texture using random data.

Parameters:
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]textureDataA pointer to the created texture data.
void MaliSDK::Texture::createTexture ( unsigned int  width,
unsigned int  height,
unsigned int  red,
GLvoid **  textureData 
)
static

Create a 1 component texture of uniform colour.

Parameters:
[in]widthThe required width of the texture.
[in]heightThe required height of the texture.
[in]redThe required red channel.
[out]textureDataOutput texture.
void MaliSDK::Texture::deleteTextureData ( GLvoid **  textureData)
static

Deletes previously created texture.

Parameters:
[in]Textureto be deleted.
void MaliSDK::Texture::getCompressedTextureFormats ( GLint **  textureFormats,
int *  numberOfTextureFormats 
)
staticprivate

Uses glGetIntegerv to get the number of compressed texture formats and the formats themselves.

Calls glGetIntegerv with GL_NUM_COMPRESSED_TEXTURE_FORMATS and GL_COMPRESSED_TEXTURE_FORMATS.

Parameters:
[out]textureFormatsPointer to the array of texture formats.
[out]numberOfTextureFormatsPointer to the number of compressed texture formats.
static bool MaliSDK::Texture::isETCSupported ( bool  verbose = false)
static

Reports whether or not ETC (Ericsson Texture Compression) is supported.

Uses getCompressedTextureFormats to get the list of supported compression formats and then checks to see if any of them are GL_ETC1_RGB8_OES.

Parameters:
[in]verboseIf true, prints out the number of supported texture compression formats and then lists the formats supported.
void MaliSDK::Texture::loadCompressedMipmaps ( const char *  filenameBase,
const char *  filenameSuffix,
GLuint *  textureID 
)
static

Load compressed mipmaps into memory.

Load the base level, calculate how many Mipmap levels there are. Load the PKM files into memory. Load the data into the texture mipmap levels.

Parameters:
[in]filenameBaseThe base filename of the texture mipmap levels. Will have the mipmap level number appended to it to load all of the mipmap levels. For example, if filenameBase = "texture_", this method will try to load the files "texture_0", "texture_1", "texture_2", etc..
[in]filenameSuffixAny suffix to the mipmap filenames. Most commonly used for file extensions. For example, if filenameSuffix = ".pkm", this method will append ".pkm" to all the files it tries to load.
[out]textureIDThe texture ID of the texture that has been loaded.
void MaliSDK::Texture::loadData ( const char *  filename,
unsigned char **  textureData 
)
static

Load texture data from a file into memory.

Parameters:
[in]filenameThe filename of the texture to load.
[out]textureDataPointer to the texture that has been loaded.
void MaliSDK::Texture::loadPKMData ( const char *  filename,
ETCHeader etcHeader,
unsigned char **  textureData 
)
static

Load header and texture data from a pkm file into memory.

Parameters:
[in]filenameThe filename of the texture to load.
[out]etcHeaderPointer to the header that has been loaded.
[out]textureDataPointer to the texture that has been loaded.

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