Files Class List
GLTextureCubeMap Class Reference

Detailed Description

OpenGL cube map texture class.

This class provides a convenient interface for handling cube map texture operations with OpenGL. This class merely stores the texture id. Note that deleting an object of this class does not automatically delete the texture from the GPU memory. You must explicitly call the Delete() method to free the texture storage on the GPU.

#include <cyGL.h>

+ Inheritance diagram for GLTextureCubeMap:

Public Types

enum  Side {
  POSITIVE_X =0, NEGATIVE_X, POSITIVE_Y, NEGATIVE_Y,
  POSITIVE_Z, NEGATIVE_Z
}
 

Public Member Functions

void SetImage (Side side, GLenum textureFormat, GLenum dataFormat, GLenum dataType, const void *data, GLsizei width, GLsizei height, int level=0)
 
template<typename T >
void SetImage (Side side, GLenum textureFormat, GLenum dataFormat, const T *data, GLsizei width, GLsizei height, int level=0)
 
template<typename T >
void SetImage (Side side, GL::Type textureType, const T *data, int numChannels, GLsizei width, GLsizei height, int level=0)
 
template<typename T >
void SetImage (Side side, const T *data, int numChannels, GLsizei width, GLsizei height, int level=0)
 
template<typename T >
void SetImageRGBA (Side side, GL::Type textureType, const T *data, GLsizei width, GLsizei height, int level=0)
 
template<typename T >
void SetImageRGB (Side side, GL::Type textureType, const T *data, GLsizei width, GLsizei height, int level=0)
 
template<typename T >
void SetImageRG (Side side, GL::Type textureType, const T *data, GLsizei width, GLsizei height, int level=0)
 
template<typename T >
void SetImageR (Side side, GL::Type textureType, const T *data, GLsizei width, GLsizei height, int level=0)
 
template<typename T >
void SetImageRGBA (Side side, const T *data, GLsizei width, GLsizei height, int level=0)
 
template<typename T >
void SetImageRGB (Side side, const T *data, GLsizei width, GLsizei height, int level=0)
 
template<typename T >
void SetImageRG (Side side, const T *data, GLsizei width, GLsizei height, int level=0)
 
template<typename T >
void SetImageR (Side side, const T *data, GLsizei width, GLsizei height, int level=0)
 
General Methods
void Delete ()
 
GLuint GetID () const
 
bool IsNull () const
 
void Bind () const
 
void Bind (int textureUnit) const
 
GLenum Type () const
 
Texture Creation and Initialization
void Initialize ()
 
void BuildMipmaps ()
 
void SetFilteringMode (GLenum magnificationFilter, GLenum minificationFilter)
 
void SetAnisotropy (float anisotropy)
 
void SetMaxAnisotropy ()
 
void SetNoAnisotropy ()
 

Member Enumeration Documentation

§ Side

enum Side

Sides of the cube map.

Member Function Documentation

§ SetImage() [1/4]

void SetImage ( Side  side,
GLenum  textureFormat,
GLenum  dataFormat,
GLenum  dataType,
const void *  data,
GLsizei  width,
GLsizei  height,
int  level = 0 
)

Sets the texture image using the given texture format, data format, and data type.

§ SetImage() [2/4]

void SetImage ( Side  side,
GLenum  textureFormat,
GLenum  dataFormat,
const T *  data,
GLsizei  width,
GLsizei  height,
int  level = 0 
)

Sets the texture image using the given texture format and data format. The data type is determined by the data pointer type.

§ SetImage() [3/4]

void SetImage ( Side  side,
GL::Type  textureType,
const T *  data,
int  numChannels,
GLsizei  width,
GLsizei  height,
int  level = 0 
)

Sets the texture image using the given texture type. The data format and type are determined by the data pointer type and the number of channels. The texture format is determined by the texture type and the number of channels.

§ SetImage() [4/4]

void SetImage ( Side  side,
const T *  data,
int  numChannels,
GLsizei  width,
GLsizei  height,
int  level = 0 
)

Sets the texture image. The texture format uses the matching data pointer type. If unsigned char is used, the texture uses 8-bit normalized values. If unsigned short is used, the texture uses 16-bit normalized values. If float is used, the texture uses non-normalized 32-bit float values. If char, short, or int is used, the texture uses non-normalized 8-bit, 16-bit, or 32-bit integer values.

§ SetImageRGBA() [1/2]

void SetImageRGBA ( Side  side,
GL::Type  textureType,
const T *  data,
GLsizei  width,
GLsizei  height,
int  level = 0 
)

Sets the texture image with 4 channels.

§ SetImageRGB() [1/2]

void SetImageRGB ( Side  side,
GL::Type  textureType,
const T *  data,
GLsizei  width,
GLsizei  height,
int  level = 0 
)

Sets the texture image with 3 channels.

§ SetImageRG() [1/2]

void SetImageRG ( Side  side,
GL::Type  textureType,
const T *  data,
GLsizei  width,
GLsizei  height,
int  level = 0 
)

Sets the texture image with 2 channels.

§ SetImageR() [1/2]

void SetImageR ( Side  side,
GL::Type  textureType,
const T *  data,
GLsizei  width,
GLsizei  height,
int  level = 0 
)

Sets the texture image with 1 channel.

§ SetImageRGBA() [2/2]

void SetImageRGBA ( Side  side,
const T *  data,
GLsizei  width,
GLsizei  height,
int  level = 0 
)

Sets the texture image with 4 channels.

§ SetImageRGB() [2/2]

void SetImageRGB ( Side  side,
const T *  data,
GLsizei  width,
GLsizei  height,
int  level = 0 
)

Sets the texture image with 3 channels.

§ SetImageRG() [2/2]

void SetImageRG ( Side  side,
const T *  data,
GLsizei  width,
GLsizei  height,
int  level = 0 
)

Sets the texture image with 2 channels.

§ SetImageR() [2/2]

void SetImageR ( Side  side,
const T *  data,
GLsizei  width,
GLsizei  height,
int  level = 0 
)

Sets the texture image with 1 channel.

§ Delete()

void Delete ( )
inherited

Deletes the texture.

§ GetID()

GLuint GetID ( ) const
inherited

Returns the texture ID.

§ IsNull()

bool IsNull ( ) const
inherited

Returns true if the OpenGL texture object is not generated, i.e. the texture id is invalid.

§ Bind() [1/2]

void Bind ( ) const
inherited

Binds the texture to the current texture unit.

§ Bind() [2/2]

void Bind ( int  textureUnit) const
inherited

Binds the texture to the given texture unit.

§ Type()

GLenum Type ( ) const
inherited

Deletes the texture.

§ Initialize()

void Initialize ( )
inherited

Generates the texture, only if the texture has not been previously generated. Initializes the texture sampling parameters.

§ BuildMipmaps()

void BuildMipmaps ( )
inherited

Builds mipmap levels for the texture. The texture image must be set first.

§ SetFilteringMode()

void SetFilteringMode ( GLenum  magnificationFilter,
GLenum  minificationFilter 
)
inherited

Sets the texture filtering mode. The acceptable values are GL_NEAREST and GL_LINEAR. The minification filter values can also be GL_NEAREST_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, or GL_LINEAR_MIPMAP_LINEAR. If the filter argument is zero, the corresponding filter parameter is not changed.

§ SetAnisotropy()

void SetAnisotropy ( float  anisotropy)
inherited

Sets the anisotropy level of the texture. The anisotropy value of 1 disables anisotropic filtering. Larger values provide provide better anisotropic filtering.

§ SetMaxAnisotropy()

void SetMaxAnisotropy ( )
inherited

Sets anisotropic filtering to the maximum permissible value.

§ SetNoAnisotropy()

void SetNoAnisotropy ( )
inherited

Turns off anisotropic filtering.