Determines whether the Texture will call glDeleteTextures() to free the associated texture objects on destruction.
GLint
getInternalFormat () const
the Texture's internal format, which is the format that OpenGL stores the texture data in memory. Common values include
GL_RGB
,
GL_RGBA
and
GL_LUMINANCE
GLuint
getId () const
the ID number for the texture, appropriate to pass to calls like
glBindTexture()
GLenum
getTarget () const
the target associated with texture. Typical values are
GL_TEXTURE_2D
and
GL_TEXTURE_RECTANGLE_ARB
void
bind (uint8_t textureUnit=0) const
Binds the Texture's texture to its target in the multitexturing unit
GL_TEXTURE0
+
textureUnit
.
void
unbind (uint8_t textureUnit=0) const
Unbinds the Texture currently bound in the Texture's target.
GLint
getWidth () const =0
Returns the width of the texture in pixels, ignoring clean bounds.
GLint
getHeight () const =0
Returns the height of the texture in pixels, ignoring clean bounds.
GLint
getDepth () const =0
Returns the depth of the texture in pixels, ignoring clean bounds.
float
getAspectRatio () const
Returns the 2D aspect ratio of the texture (width / height), ignoring clean bounds.
Returns the
Area
defining the Texture's bounds in pixels, ignoring clean bounds.
bool
hasAlpha () const
Returns whether the Texture has an alpha channel based on its internal format.
void
setWrap (GLenum wrapS, GLenum wrapT)
Sets the wrapping behavior when a texture coordinate falls outside the range of [0,1]. Possible values are
GL_REPEAT
,
GL_CLAMP_TO_EDGE
, etc. Default is
GL_CLAMP_TO_EDGE
.
Sets the wrapping behavior when a texture coordinate falls outside the range of [0,1]. Possible values are
GL_REPEAT
,
GL_CLAMP_TO_EDGE
, etc. Default is
GL_CLAMP_TO_EDGE
.
void
setWrapS (GLenum wrapS)
Sets the horizontal wrapping behavior when a texture coordinate falls outside the range of [0,1]. Possible values are
GL_REPEAT
and
GL_CLAMP_TO_EDGE
, etc. Default is
GL_CLAMP_TO_EDGE
.
void
setWrapT (GLenum wrapT)
Sets the vertical wrapping behavior when a texture coordinate falls outside the range of [0,1]. Possible values are
GL_REPEAT
,
GL_CLAMP_TO_EDGE
, etc. Default is
GL_CLAMP_TO_EDGE
.
void
setWrapR (GLenum wrapR)
Sets the depth wrapping behavior when a texture coordinate falls outside the range of [0,1]. Possible values are
GL_REPEAT
,
GL_CLAMP_TO_EDGE
, etc. Default is
GL_CLAMP_TO_EDGE
.
void
setMinFilter (GLenum minFilter)
Sets the filtering behavior when a texture is displayed at a lower resolution than its native resolution. Possible values are.
GL_NEAREST
GL_LINEAR
GL_NEAREST_MIPMAP_NEAREST
GL_LINEAR_MIPMAP_NEAREST
GL_NEAREST_MIPMAP_LINEAR
GL_LINEAR_MIPMAP_LINEAR
void
setMagFilter (GLenum magFilter)
Sets the filtering behavior when a texture is displayed at a higher resolution than its native resolution. Possible values are
GL_NEAREST
GL_LINEAR
void
setMaxAnisotropy (GLfloat maxAnisotropy)
Sets the anisotropic filtering amount. A value greater than 1.0 "enables" anisotropic filtering. Maximum of
getMaxAnisotropyMax()
;.
bool
hasMipmapping () const
Returns whether the Texture has Mipmapping enabled.
void
setCompareMode (GLenum compareMode)
void
setCompareFunc (GLenum compareFunc)
std::array< GLint, 4 >
getSwizzleMask () const
Returns the Texture's swizzle mask (corresponding to
GL_TEXTURE_SWIZZLE_RGBA
)
const std::string &
getLabel () const
Returns the debugging label associated with the Texture.
void
setLabel (const std::string &label)
Sets the debugging label associated with the Texture. Calls glObjectLabel() when available.
Static Public Member Functions
GLenum
getBindingConstantForTarget (GLenum target)
Returns the appropriate parameter to glGetIntegerv() for a specific target; ie GL_TEXTURE_2D -> GL_TEXTURE_BINDING_2D. Returns 0 on failure.
Returns the corresponding legal values for glTexImage*D() calls for dataFormat and dataType based on
internalFormat
, as well as whether the internal format contains an alpha channel, is compressed, and is in the sRGB color space.