class ffw::GLTexture2DArray
Class List > ffw :: GLTexture2DArray
OpenGL texture of type GL_TEXTURE_2D_ARRAY.
Inherits the following classes: ffw::GLTexture
Public Functions
Type | Name |
---|---|
GLTexture2DArray () | |
GLTexture2DArray (const GLTexture2DArray & other) = delete | |
GLTexture2DArray (GLTexture2DArray && other) | |
virtual | ~GLTexture2DArray () = default |
GLTexture2DArray (GLsizei width, GLsizei height, GLsizei layers, GLenum internalformat, GLenum format, GLenum pixelformat, const GLvoid * pixels = nullptr) Allocates the texture. | |
void | resize (GLsizei width, GLsizei height, GLsizei layers, const GLvoid * pixels = nullptr) Resizes the texture. |
void | setPixels (GLint level, const GLvoid * pixels) Sets the pixels of the entire texture. |
void | setPixels (GLint level, GLint xoffset, GLint yoffset, GLint loffset, GLsizei width, GLsizei height, const GLvoid * pixels) Sets the pixels of the texture section. |
void | getPixels (GLvoid * pixels) const Returns the pixels of the entire texture. |
GLTexture2DArray & | operator= (const GLTexture2DArray & second) = delete |
GLTexture2DArray & | operator= (GLTexture2DArray && second) |
Public Functions Documentation
function GLTexture2DArray (1/4)
ffw::GLTexture2DArray::GLTexture2DArray ()
function GLTexture2DArray (2/4)
ffw::GLTexture2DArray::GLTexture2DArray (
const GLTexture2DArray & other
) = delete
function GLTexture2DArray (3/4)
ffw::GLTexture2DArray::GLTexture2DArray (
GLTexture2DArray && other
)
function ~GLTexture2DArray
virtual ffw::GLTexture2DArray::~GLTexture2DArray () = default
function GLTexture2DArray (4/4)
ffw::GLTexture2DArray::GLTexture2DArray (
GLsizei width,
GLsizei height,
GLsizei layers,
GLenum internalformat,
GLenum format,
GLenum pixelformat,
const GLvoid * pixels = nullptr
)
Allocates the texture.
Parameters:
- width Specifies the width of the texture image.
- height Specifies the height of the texture image.
- layers Specifies the number of laters of the texture image.
- internalformat Specifies the number of color components in the texture.
- format Specifies the format of the pixel data. The following symbolic values are accepted: GL_RED, GL_RG, GL_RGB, GL_BGR, GL_RGBA, GL_BGRA, GL_RED_INTEGER, GL_RG_INTEGER, GL_RGB_INTEGER, GL_BGR_INTEGER, GL_RGBA_INTEGER, GL_BGRA_INTEGER, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT, GL_DEPTH_STENCIL.
- pixelformat Specifies the data type of the pixel data. The following symbolic values are accepted: GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, and GL_UNSIGNED_INT_2_10_10_10_REV.
- pixels Optional array to the pixels buffer that will be used to initialise the texture storage. The pixel array must be correct size, otherwise a segmentation fault will occur. If null, the texture storage is not set and initialised with random data.
Exception:
- GLException if something went wrong
The following compressed internalformats are allowed: GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_RED_RGTC1, GL_COMPRESSED_RG_RGTC2, GL_COMPRESSED_SIGNED_RED_RGTC1, GL_COMPRESSED_SIGNED_RG_RGTC2
Note:
The texture is automatically destroyed once destroy() is called, or the instance of this texture class is freed.
function resize
void ffw::GLTexture2DArray::resize (
GLsizei width,
GLsizei height,
GLsizei layers,
const GLvoid * pixels = nullptr
)
Resizes the texture.
Parameters:
- width The new width of the texture
- height The new height of the texture
- layers The new number of layers of the texture
- pixels Optional array to the pixels buffer that will be used to initialise the texture storage. The pixel array must be correct size, otherwise a segmentation fault will occur. If null, the texture storage is not set and initialised with random data.
Note:
The format, internalformat, and pixelformat are unchanged.
Exception:
- GLException if the texture has not been allocated
function setPixels (1/2)
void ffw::GLTexture2DArray::setPixels (
GLint level,
const GLvoid * pixels
)
Sets the pixels of the entire texture.
Parameters:
- level The mipmap level to set. Zero by default.
- pixels Non null pointer to the array of the pixels to upload.
Exception:
- GLException if the texture has not been allocated
function setPixels (2/2)
void ffw::GLTexture2DArray::setPixels (
GLint level,
GLint xoffset,
GLint yoffset,
GLint loffset,
GLsizei width,
GLsizei height,
const GLvoid * pixels
)
Sets the pixels of the texture section.
Parameters:
- level The mipmap level to set. Zero by default.
- xoffset The x offset of the target area to set.
- yoffset The y offset of the target area to set.
- loffset The layer offset.
- width The width of the area to set.
- height The height of the area to set.
- pixels Non null pointer to the array of the pixels to upload.
Exception:
- GLException if the texture has not been allocated
function getPixels
void ffw::GLTexture2DArray::getPixels (
GLvoid * pixels
) const
Returns the pixels of the entire texture.
Parameters:
- pixels Non null pointer to an allocated array that will hold the entire texture data.
Exception:
- GLException if the texture has not been allocated
function operator= (1/2)
GLTexture2DArray & ffw::GLTexture2DArray::operator= (
const GLTexture2DArray & second
) = delete
function operator= (2/2)
GLTexture2DArray & ffw::GLTexture2DArray::operator= (
GLTexture2DArray && second
)
The documentation for this class was generated from the following file: include/ffw/graphics/gltexture2darray.h