Public Member Functions | |
CTextureState (void) | |
Constructs a CTextureState object. | |
virtual | ~CTextureState (void) |
Destructor. | |
int | getMaxTextureUnits (void) |
Returns the number of texture mapping units available. | |
void | setTexture (int textureUnit, const QImage &image) |
Assigns a texture image to a texture mapping unit. | |
void | setBilinearFilter (bool enable) |
Enables/disables texture filering. | |
void | init (void) |
Initializes the object. | |
void | shutdown (void) |
Frees resources and cleans up state. | |
void | bindState (void) |
Binds the textures to the OpenGL context. |
CTextureState::CTextureState | ( | void | ) |
Constructs a CTextureState object.
The object must be initialized before use.
int CTextureState::getMaxTextureUnits | ( | void | ) | [inline, virtual] |
Returns the number of texture mapping units available.
This invokes an OpenGL call and returns the value of GL_MAX_TEXTURE_UNITS.
Implements ITextureState.
void CTextureState::setTexture | ( | int | textureUnit, | |
const QImage & | image | |||
) | [virtual] |
Assigns a texture image to a texture mapping unit.
This call replaces the current image with a new image. It re-creates the complete OpenGL texture object. Depending on the image, this may take some time. Do not call this every frame, it will slow down the application.
textureUnit | Zero based index of a texture unit. The maximum index is n-1 where n is the value returned by glMaxTextureUnits(). | |
image | The image to use. |
Implements ITextureState.
void CTextureState::setBilinearFilter | ( | bool | enable | ) | [inline, virtual] |
Enables/disables texture filering.
This controls bilinear filtering on all textures. The initial state is false.
enable | Filtering enable state. |
Implements ITextureState.
void CTextureState::init | ( | void | ) |
Initializes the object.
After this call, the object can be used to manage textures.
void CTextureState::shutdown | ( | void | ) |
Frees resources and cleans up state.
Must be called before destruction.