class ffw::GLTexture3D

Class List > ffw :: GLTexture3D

OpenGL texture of type GL_TEXTURE_3D.

Inherits the following classes: ffw::GLTexture

Public Functions

Type Name
GLTexture3D ()
GLTexture3D (const GLTexture3D & other) = delete
GLTexture3D (GLTexture3D && other)
virtual ~GLTexture3D () = default
GLTexture3D (GLsizei width, GLsizei height, GLsizei depth, GLenum internalformat, GLenum format, GLenum pixelformat, const GLvoid * pixels = nullptr)
Allocates the texture.
void resize (GLsizei width, GLsizei height, GLsizei depth, const GLvoid * pixels = nullptr)
Resizes the texture.
void setPixels (GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, const GLvoid * pixels)
Sets the pixels of the texture section.
void setPixels (GLint level, const GLvoid * pixels)
Sets the pixels of the entire texture.
void getPixels (GLvoid * pixels)
Returns the pixels of the entire texture.
GLTexture3D & operator= (const GLTexture3D & other) = delete
GLTexture3D & operator= (GLTexture3D && other)

Public Functions Documentation

function GLTexture3D (1/4)

ffw::GLTexture3D::GLTexture3D ()

function GLTexture3D (2/4)

ffw::GLTexture3D::GLTexture3D (
    const GLTexture3D & other
) = delete

function GLTexture3D (3/4)

ffw::GLTexture3D::GLTexture3D (
    GLTexture3D && other
)

function ~GLTexture3D

virtual ffw::GLTexture3D::~GLTexture3D () = default

function GLTexture3D (4/4)

ffw::GLTexture3D::GLTexture3D (
    GLsizei width,
    GLsizei height,
    GLsizei depth,
    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.
  • depth Specifies the depth 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:

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::GLTexture3D::resize (
    GLsizei width,
    GLsizei height,
    GLsizei depth,
    const GLvoid * pixels = nullptr
)

Resizes the texture.

Parameters:

  • width The new width of the texture
  • height The new height of the texture
  • depth The new depth 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:

function setPixels (1/2)

void ffw::GLTexture3D::setPixels (
    GLint level,
    GLint xoffset,
    GLint yoffset,
    GLint zoffset,
    GLsizei width,
    GLsizei height,
    GLsizei depth,
    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.
  • zoffset The z offset of the target area to set.
  • width The width of the area to set.
  • height The height of the area to set.
  • depth The depth of the area to set.
  • pixels Non null pointer to the array of the pixels to upload.

Exception:

function setPixels (2/2)

void ffw::GLTexture3D::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:

function getPixels

void ffw::GLTexture3D::getPixels (
    GLvoid * pixels
)

Returns the pixels of the entire texture.

Parameters:

  • pixels Non null pointer to an allocated array that will hold the entire texture data.

Exception:

function operator= (1/2)

GLTexture3D & ffw::GLTexture3D::operator= (
    const GLTexture3D & other
) = delete

function operator= (2/2)

GLTexture3D & ffw::GLTexture3D::operator= (
    GLTexture3D && other
)

The documentation for this class was generated from the following file: include/ffw/graphics/gltexture3d.h