class ffw::GLTextureCubemap

Class List > ffw :: GLTextureCubemap

OpenGL texture of type GL_TEXTURE_CUBE_MAP.

Inherits the following classes: ffw::GLTexture

Public Functions

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

Public Functions Documentation

function GLTextureCubemap (1/4)

ffw::GLTextureCubemap::GLTextureCubemap ()

function GLTextureCubemap (2/4)

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

function GLTextureCubemap (3/4)

ffw::GLTextureCubemap::GLTextureCubemap (
    GLTextureCubemap && other
)

function ~GLTextureCubemap

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

function GLTextureCubemap (4/4)

ffw::GLTextureCubemap::GLTextureCubemap (
    GLsizei width,
    GLsizei height,
    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.
  • 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::GLTextureCubemap::resize (
    GLsizei width,
    GLsizei height
)

Resizes the texture.

Parameters:

  • width The new width of the texture
  • height The new height of the texture

Note:

The format, internalformat, and pixelformat are unchanged. The pixels are not set and allocated with random data.

Exception:

function setPixels (1/2)

void ffw::GLTextureCubemap::setPixels (
    GLint level,
    GLint xoffset,
    GLint yoffset,
    GLsizei width,
    GLsizei height,
    GLint side,
    const GLvoid * pixels
)

Sets the pixels.

The side parameter corresponds to which side should be set. The accepted values are from 0 to 5 where each number represents:

  • 0: GL_TEXTURE_CUBE_MAP_POSITIVE_X (Right)
  • 1: GL_TEXTURE_CUBE_MAP_NEGATIVE_X (Left)
  • 2: GL_TEXTURE_CUBE_MAP_POSITIVE_Y (Top)
  • 3: GL_TEXTURE_CUBE_MAP_NEGATIVE_Y (Bottom)
  • 4: GL_TEXTURE_CUBE_MAP_POSITIVE_Z (Back)
  • 5: GL_TEXTURE_CUBE_MAP_NEGATIVE_Z (Front)

Exception:

function setPixels (2/2)

void ffw::GLTextureCubemap::setPixels (
    GLint level,
    GLint side,
    const GLvoid * pixels
)

Sets the pixels of the entire texture.

Parameters:

  • level The mipmap level to set. Zero by default.
  • side Which side to set. Starting from zero (e.g. GL_TEXTURE_CUBE_MAP_POSITIVE_X) up to 5 (e.g. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z). See setPixels function.
  • pixels Non null pointer to the array of the pixels to upload.

Exception:

function getPixels

void ffw::GLTextureCubemap::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)

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

function operator= (2/2)

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

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