class ffw::GLTexture
Class List > ffw :: GLTexture
Base class for all texture types.
Inherited by the following classes: ffw::GLTexture1D, ffw::GLTexture1DArray, ffw::GLTexture2D, ffw::GLTexture2DArray, ffw::GLTexture2DArrayMS, ffw::GLTexture2DMS, ffw::GLTexture3D, ffw::GLTextureCubemap
Public Types
Type | Name |
---|---|
enum | Filtering { NEAREST, LINEAR, MIPMAP_NEAREST, MIPMAP_LINEAR } |
enum | Wrapping { REPEAT, MIRRORED_REPEAT, CLAMP_TO_EDGE } |
Protected Attributes
Type | Name |
---|---|
bool | loaded |
GLenum | textureformat |
GLenum | internalformat |
GLenum | format |
GLenum | pixelformat |
GLuint | buffer |
GLsizei | width |
GLsizei | height |
GLsizei | depth |
GLsizei | layers |
bool | mipmaps |
bool | initialized |
GLsizei | samples |
bool | compressed |
Public Functions
Type | Name |
---|---|
GLTexture () | |
GLTexture (const GLTexture & other) = delete | |
GLTexture (GLTexture && other) | |
void | swap (GLTexture & other) |
virtual | ~GLTexture () |
bool | isCreated () const |
void | destroy () Releases the resources. |
void | bind () const Binds the texture. |
void | unbind () const Unbinds the texture. |
GLuint | getHandle () const Returns the OpenGL pointer, a handle to the texture. |
GLsizei | getWidth () const Returns the width of the texture. |
GLsizei | getHeight () const Returns the height of the texture. |
GLsizei | getLayers () const Returns the number of layers. |
GLsizei | getDepth () const Returns the depth of the texture. |
GLsizei | getSamples () const |
GLenum | getInternalFormat () const Returns the number of color components in the texture. |
GLenum | getFormat () const Returns the format of the pixel data. |
GLenum | getPixelFormat () const Returns the data type of the pixel data. |
GLenum | getTextureFormat () const Returns the type of the texture. |
bool | isCompressed () const |
void | setEnvParami (GLenum target, GLenum name, GLint value) const |
void | setEnvParamf (GLenum target, GLenum name, GLfloat value) const |
void | setTexParami (GLenum name, GLint value) const |
void | setTexParamiv (GLenum name, const GLint * value) const |
void | setTexParamf (GLenum name, GLfloat value) const |
void | setTexParamfv (GLenum name, const GLfloat * value) const |
void | generateMipmaps () Generates mip maps. |
void | setFiltering (GLTexture::Filtering filtering) const |
void | setWrapping (GLTexture::Wrapping wrapping) const |
GLTexture & | operator= (const GLTexture & other) = delete |
GLTexture & | operator= (GLTexture && other) |
Protected Functions
Type | Name |
---|---|
GLsizei | getBlockSize (const GLsizei width, const GLsizei height = 1, const GLsizei depth = 1) const |
Public Types Documentation
enum Filtering
enum ffw::GLTexture::Filtering {
NEAREST,
LINEAR,
MIPMAP_NEAREST,
MIPMAP_LINEAR,
};
enum Wrapping
enum ffw::GLTexture::Wrapping {
REPEAT,
MIRRORED_REPEAT,
CLAMP_TO_EDGE,
};
Protected Attributes Documentation
variable loaded
bool ffw::GLTexture::loaded;
variable textureformat
GLenum ffw::GLTexture::textureformat;
variable internalformat
GLenum ffw::GLTexture::internalformat;
variable format
GLenum ffw::GLTexture::format;
variable pixelformat
GLenum ffw::GLTexture::pixelformat;
variable buffer
GLuint ffw::GLTexture::buffer;
variable width
GLsizei ffw::GLTexture::width;
variable height
GLsizei ffw::GLTexture::height;
variable depth
GLsizei ffw::GLTexture::depth;
variable layers
GLsizei ffw::GLTexture::layers;
variable mipmaps
bool ffw::GLTexture::mipmaps;
variable initialized
bool ffw::GLTexture::initialized;
variable samples
GLsizei ffw::GLTexture::samples;
variable compressed
bool ffw::GLTexture::compressed;
Public Functions Documentation
function GLTexture (1/3)
ffw::GLTexture::GLTexture ()
function GLTexture (2/3)
ffw::GLTexture::GLTexture (
const GLTexture & other
) = delete
function GLTexture (3/3)
ffw::GLTexture::GLTexture (
GLTexture && other
)
function swap
void ffw::GLTexture::swap (
GLTexture & other
)
function ~GLTexture
virtual ffw::GLTexture::~GLTexture ()
function isCreated
bool ffw::GLTexture::isCreated () const
function destroy
void ffw::GLTexture::destroy ()
Releases the resources.
function bind
void ffw::GLTexture::bind () const
Binds the texture.
function unbind
void ffw::GLTexture::unbind () const
Unbinds the texture.
Note:
After the unbind the active texture will be set to no handle (zero)
function getHandle
GLuint ffw::GLTexture::getHandle () const
Returns the OpenGL pointer, a handle to the texture.
function getWidth
GLsizei ffw::GLTexture::getWidth () const
Returns the width of the texture.
function getHeight
GLsizei ffw::GLTexture::getHeight () const
Returns the height of the texture.
If the texture is 1D texture, the returned type is always 1.
function getLayers
GLsizei ffw::GLTexture::getLayers () const
Returns the number of layers.
If the texture is not an array, the returned value is always 1.
function getDepth
GLsizei ffw::GLTexture::getDepth () const
Returns the depth of the texture.
This only applies to 3D texture, otherwise returns 1.
function getSamples
GLsizei ffw::GLTexture::getSamples () const
function getInternalFormat
GLenum ffw::GLTexture::getInternalFormat () const
Returns the number of color components in the texture.
The internal format can be GL_RGB8, GL_RGBA8, GL_RGB32F, etc...
function getFormat
GLenum ffw::GLTexture::getFormat () const
Returns the format of the pixel data.
The format can be GL_RGB, GL_RED, GL_RGBA, etc...
function getPixelFormat
GLenum ffw::GLTexture::getPixelFormat () const
Returns the data type of the pixel data.
The pixel format can be GL_UNSIGNED_BYTE, GL_FLOAT, etc...
function getTextureFormat
GLenum ffw::GLTexture::getTextureFormat () const
Returns the type of the texture.
The texture format can be GL_TEXTURE_1D, GL_TEXTURE_2D, etc...
function isCompressed
bool ffw::GLTexture::isCompressed () const
function setEnvParami
void ffw::GLTexture::setEnvParami (
GLenum target,
GLenum name,
GLint value
) const
Exception:
- GLException if the texture is not allocated
function setEnvParamf
void ffw::GLTexture::setEnvParamf (
GLenum target,
GLenum name,
GLfloat value
) const
Exception:
- GLException if the texture is not allocated
function setTexParami
void ffw::GLTexture::setTexParami (
GLenum name,
GLint value
) const
Exception:
- GLException if the texture is not allocated
function setTexParamiv
void ffw::GLTexture::setTexParamiv (
GLenum name,
const GLint * value
) const
Exception:
- GLException if the texture is not allocated
function setTexParamf
void ffw::GLTexture::setTexParamf (
GLenum name,
GLfloat value
) const
Exception:
- GLException if the texture is not allocated
function setTexParamfv
void ffw::GLTexture::setTexParamfv (
GLenum name,
const GLfloat * value
) const
Exception:
- GLException if the texture is not allocated
function generateMipmaps
void ffw::GLTexture::generateMipmaps ()
Generates mip maps.
Exception:
- GLException if the texture is not allocated
function setFiltering
void ffw::GLTexture::setFiltering (
GLTexture::Filtering filtering
) const
Exception:
- GLException if the texture is not allocated
function setWrapping
void ffw::GLTexture::setWrapping (
GLTexture::Wrapping wrapping
) const
Exception:
- GLException if the texture is not allocated
function operator= (1/2)
GLTexture & ffw::GLTexture::operator= (
const GLTexture & other
) = delete
function operator= (2/2)
GLTexture & ffw::GLTexture::operator= (
GLTexture && other
)
Protected Functions Documentation
function getBlockSize
GLsizei ffw::GLTexture::getBlockSize (
const GLsizei width,
const GLsizei height = 1,
const GLsizei depth = 1
) const
The documentation for this class was generated from the following file: include/ffw/graphics/gltexture.h