dms::Texture

Source Code

Class Specification

#include <dms/Texture.h>

Texture(GLint wrap=GL_REPEAT, GLint min=GL_LINEAR, GLint mag=GL_LINEAR);
virtual ~Texture(void);
virtual void apply(void) = 0;
virtual void disable(void) = 0;

void setMinFilter(GLint);
void setMagFilter(GLint);
void setWrapS(GLint);
void setWrapT(GLint);
void setWrapR(GLint);
void setWrap(GLint v);
GLint minFilter(void) const;
GLint magFilter(void) const;
GLint wrapS(void) const;
GLint wrapT(void) const;
GLint wrapR(void) const;

Description

Texture(GLint wrap, GLint min, GLint mag)

By default, the constructor creates a Texture that uses GL_REPEAT wrapping, and GL_LINEAR minification and magnification filters.
Since Texture is an abstract class, its constructor is never called directly; it is called by its derived classes' constructors, such as for Texture2D.

void apply(void)

apply() is a function that must be defined by derived classes. It is used to enable the texture.

void disable(void)

apply() is a function that must be defined by derived classes. It is used to turn off the texture.

void setMinFilter(GLint filter)
GLint minFilter(void)

Sets / returns the minification filter for the texture. Valid arguments are those that can be used for the GL_TEXTURE_MIN_FILTER option of glTexParameter().
Example:

texture.setMinFilter(GL_LINEAR_MIPMAP_LINEAR);
void setMagFilter(GLint filter)
GLint magFilter(void)

Sets / returns the magnification filter for the texture. Valid arguments are those that can be used for the GL_TEXTURE_MAG_FILTER option of glTexParameter().
Example:

texture.setMagFilter(GL_NEAREST);
void setWrapS(GLint mode)
void setWrapT(GLint mode)
void setWrapR(GLint mode)
GLint wrapS(void)
GLint wrapT(void)
GLint wrapR(void)

Sets / returns the texture wrapping mode for the S, R, or T texture coordinate. Valid arguments are GL_REPEAT, GL_CLAMP, and GL_CLAMP_TO_EDGE.
Example:

texture.setWrapS(GL_REPEAT);
texture.setWrapT(GL_CLAMP);
void setWrap(GLint mode)

Sets all of the texture wrapping modes to the given value. Valid arguments are GL_REPEAT, GL_CLAMP, and GL_CLAMP_TO_EDGE.
Example:

texture.setWrap(GL_CLAMP);