A base class for creating OpenGL texture objects.
More...
#include <Texture.h>
List of all members.
Public Member Functions |
| Texture (GLenum _target, GLenum _format, GLenum _dataType, int _samplerIndex) |
| Constructor.
|
| ~Texture () |
| Destructor.
|
void | setTextureParameter (GLenum _target, GLenum _paramName, GLfloat _paramValue) |
| Sets a texture (floating point) parameter.
|
void | setTextureParameter (GLenum _target, GLenum _paramName, GLint _paramValue) |
| Sets a texture (integer) parameter.
|
void | read (GLenum _target, GLint _mipLevel, GLenum _format, GLenum _dataType, void *_readData) |
| Reads the texture's data.
|
void | bind () |
| Binds the texture object.
|
void | unbind () |
| Unbinds the texture object.
|
bool | isBound () const |
| Returns if the texture is bound.
|
GLenum | getTarget () const |
| Accessor for the texture's target.
|
GLenum | getFormat () const |
| Accessor for the texture's format.
|
GLenum | getDataType () const |
| Accessor for the texture's data type.
|
GLuint | getHandle () const |
| Accessor for the texture's handle.
|
GLenum | getImageUnit () const |
| Accessor for the texture's image unit.
|
int | getSamplerIndex () const |
| Accessor for the texture's sampler index.
|
Protected Attributes |
GLenum | m_target |
| The texture's target. Can be GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, or GL_TEXTURE_CUBE_MAP.
|
GLenum | m_format |
| The texture's data format.
|
GLenum | m_dataType |
| The texture's data type.
|
GLuint | m_handle |
| The texture's handle.
|
GLenum | m_imageUnit |
| The texture image unit to attach the texture to.
|
int | m_samplerIndex |
| The texture's sampler index.
|
bool | m_isBound |
| A flag to indicate if the texture is bound.
|
Detailed Description
A base class for creating OpenGL texture objects.
- Author:
- Nikolaos Verigakis
- Version:
- 1.0
- Date:
- 14/07/11 Revision History : Initial Version 14/07/11
Constructor & Destructor Documentation
Texture::Texture |
( |
GLenum |
_target, |
|
|
GLenum |
_format, |
|
|
GLenum |
_dataType, |
|
|
int |
_samplerIndex |
|
) |
| |
Constructor.
- Parameters:
-
[in] | _target | the target texture |
[in] | _format | the format of the pixel data |
[in] | _dataType | the data type of the pixel data |
[in] | _samplerIndex | the sampler's index |
Member Function Documentation
void Texture::read |
( |
GLenum |
_target, |
|
|
GLint |
_mipLevel, |
|
|
GLenum |
_format, |
|
|
GLenum |
_dataType, |
|
|
void * |
_readData |
|
) |
| |
Reads the texture's data.
- Parameters:
-
[in] | _target | the texture's target |
[in] | _mipLevel | the texture's mipmap level |
[in] | _format | the texture's format |
[in] | _dataType | the texture's data type |
[in] | _readData | a pointer to the data to read to |
void Texture::setTextureParameter |
( |
GLenum |
_target, |
|
|
GLenum |
_paramName, |
|
|
GLfloat |
_paramValue |
|
) |
| |
Sets a texture (floating point) parameter.
- Parameters:
-
[in] | _target | the exture target |
[in] | _paramName | the parameter's name |
[in] | _paramValue | the parameter's value |
void Texture::setTextureParameter |
( |
GLenum |
_target, |
|
|
GLenum |
_paramName, |
|
|
GLint |
_paramValue |
|
) |
| |
Sets a texture (integer) parameter.
- Parameters:
-
[in] | _target | the exture target |
[in] | _paramName | the parameter's name |
[in] | _paramValue | the parameter's value |
The documentation for this class was generated from the following files: