Magnum::CubeMapTexture class

Cube map texture.

Texture used mainly for environment maps. It consists of 6 square textures generating 6 faces of the cube as following. Note that all images must be turned upside down (+Y is top):

          +----+
          | -Y |
+----+----+----+----+
| -Z | -X | +Z | +X |
+----+----+----+----+
          | +Y |
          +----+

Basic usage

See Texture documentation for introduction.

Common usage is to fully configure all texture parameters and then set the data from e.g. set of Image objects:

ImageView2D positiveX(PixelFormat::RGBA, PixelType::UnsignedByte, {256, 256}, data);
// ...

CubeMapTexture texture;
texture.setMagnificationFilter(Sampler::Filter::Linear)
    // ...
    .setStorage(Math::log2(256)+1, TextureFormat::RGBA8, {256, 256})
    .setSubImage(CubeMapCoordinate::PositiveX, 0, {}, positiveX)
    .setSubImage(CubeMapCoordinate::NegativeX, 0, {}, negativeX)
    // ...

In shader, the texture is used via samplerCube, samplerCubeShadow, isamplerCube or usamplerCube. Unlike in classic textures, coordinates for cube map textures is signed three-part vector from the center of the cube, which intersects one of the six sides of the cube map. See AbstractShaderProgram for more information about usage in shaders.

Base classes

class AbstractTexture
Base for textures.

Public types

using Coordinate = CubeMapCoordinate deprecated
Cube map coordinate.

Public static functions

static auto maxSize() -> Vector2i
Max supported size of one side of cube map texture.
static auto compressedBlockSize(TextureFormat format) -> Vector2i
Compressed block size.
static auto compressedBlockDataSize(TextureFormat format) -> Int
Compressed block data size.
static auto wrap(GLuint id, ObjectFlags flags = {}) -> CubeMapTexture
Wrap existing OpenGL cube map texture object.

Constructors, destructors, conversion operators

CubeMapTexture() explicit
Constructor.
CubeMapTexture(NoCreateT) explicit noexcept
Construct without creating the underlying OpenGL object.

Public functions

void bindImage(Int imageUnit, Int level, CubeMapCoordinate coordinate, ImageAccess access, ImageFormat format)
Bind level of given cube map texture coordinate to given image unit.
void bindImageLayered(Int imageUnit, Int level, ImageAccess access, ImageFormat format)
Bind level of layered cube map texture to given image unit.
auto setBaseLevel(Int level) -> CubeMapTexture&
Set base mip level.
auto setMaxLevel(Int level) -> CubeMapTexture&
Set max mip level.
auto setMinificationFilter(Sampler::Filter filter, Sampler::Mipmap mipmap = Sampler::Mipmap::Base) -> CubeMapTexture&
Set minification filter.
auto setMagnificationFilter(Sampler::Filter filter) -> CubeMapTexture&
Set magnification filter.
auto setMinLod(Float lod) -> CubeMapTexture&
Set minimum level-of-detail parameter.
auto setMaxLod(Float lod) -> CubeMapTexture&
Set maximum level-of-detail parameter.
auto setLodBias(Float bias) -> CubeMapTexture&
Set level-of-detail bias.
auto setWrapping(const Array2D<Sampler::Wrapping>& wrapping) -> CubeMapTexture&
Set wrapping.
auto setBorderColor(const Color4& color) -> CubeMapTexture&
Set border color.
auto setBorderColor(const Vector4ui& color) -> CubeMapTexture&
Set border color for integer texture.
auto setBorderColor(const Vector4i& color) -> CubeMapTexture&
auto setMaxAnisotropy(Float anisotropy) -> CubeMapTexture&
Set max anisotropy.
auto setSRGBDecode(bool decode) -> CubeMapTexture&
Set sRGB decoding.
template<char r, char g, char b, char a>
auto setSwizzle() -> CubeMapTexture&
Set component swizzle.
auto setCompareMode(Sampler::CompareMode mode) -> CubeMapTexture&
Set depth texture comparison mode.
auto setCompareFunction(Sampler::CompareFunction function) -> CubeMapTexture&
Set depth texture comparison function.
auto setDepthStencilMode(Sampler::DepthStencilMode mode) -> CubeMapTexture&
Set depth/stencil texture mode.
auto setStorage(Int levels, TextureFormat internalFormat, const Vector2i& size) -> CubeMapTexture&
Set storage.
auto imageSize(Int level) -> Vector2i
Image size in given mip level.
void image(Int level, Image3D& image)
Read given mip level of texture to image.
auto image(Int level, Image3D&& image) -> Image3D
void image(Int level, BufferImage3D& image, BufferUsage usage)
Read given mip level of texture to buffer image.
auto image(Int level, BufferImage3D&& image, BufferUsage usage) -> BufferImage3D
void compressedImage(Int level, CompressedImage3D& image)
Read given mip level of compressed texture to image.
auto compressedImage(Int level, CompressedImage3D&& image) -> CompressedImage3D
void compressedImage(Int level, CompressedBufferImage3D& image, BufferUsage usage)
Read given mip level of compressed texture to buffer image.
auto compressedImage(Int level, CompressedBufferImage3D&& image, BufferUsage usage) -> CompressedBufferImage3D
void image(CubeMapCoordinate coordinate, Int level, Image2D& image)
Read given mip level and coordinate of texture to image.
auto image(CubeMapCoordinate coordinate, Int level, Image2D&& image) -> Image2D
void image(CubeMapCoordinate coordinate, Int level, BufferImage2D& image, BufferUsage usage)
Read given mip level and coordinate of texture to buffer image.
auto image(CubeMapCoordinate coordinate, Int level, BufferImage2D&& image, BufferUsage usage) -> BufferImage2D
void compressedImage(CubeMapCoordinate coordinate, Int level, CompressedImage2D& image)
Read given mip level and coordinate of compressed texture to image.
auto compressedImage(CubeMapCoordinate coordinate, Int level, CompressedImage2D&& image) -> CompressedImage2D
void compressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D& image, BufferUsage usage)
Read given mip level and coordinate of compressed texture to buffer image.
auto compressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D&& image, BufferUsage usage) -> CompressedBufferImage2D
void subImage(Int level, const Range3Di& range, Image3D& image)
Read range of given texture mip level to image.
auto subImage(Int level, const Range3Di& range, Image3D&& image) -> Image3D
void subImage(Int level, const Range3Di& range, BufferImage3D& image, BufferUsage usage)
Read range of given texture mip level to buffer image.
auto subImage(Int level, const Range3Di& range, BufferImage3D&& image, BufferUsage usage) -> BufferImage3D
void compressedSubImage(Int level, const Range3Di& range, CompressedImage3D& image)
Read range of given compressed texture mip level to image.
auto compressedSubImage(Int level, const Range3Di& range, CompressedImage3D&& image) -> CompressedImage3D
void compressedSubImage(Int level, const Range3Di& range, CompressedBufferImage3D& image, BufferUsage usage)
Read range of given compressed texture mip level to buffer image.
auto compressedSubImage(Int level, const Range3Di& range, CompressedBufferImage3D&& image, BufferUsage usage) -> CompressedBufferImage3D
auto setImage(CubeMapCoordinate coordinate, Int level, TextureFormat internalFormat, const ImageView2D& image) -> CubeMapTexture&
Set image data.
auto setImage(CubeMapCoordinate coordinate, Int level, TextureFormat internalFormat, BufferImage2D& image) -> CubeMapTexture&
auto setImage(CubeMapCoordinate coordinate, Int level, TextureFormat internalFormat, BufferImage2D&& image) -> CubeMapTexture&
auto setCompressedImage(CubeMapCoordinate coordinate, Int level, const CompressedImageView2D& image) -> CubeMapTexture&
Set compressed image data.
auto setCompressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D& image) -> CubeMapTexture&
auto setCompressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D&& image) -> CubeMapTexture&
auto setSubImage(Int level, const Vector3i& offset, const ImageView3D& image) -> CubeMapTexture&
Set image subdata.
auto setSubImage(Int level, const Vector3i& offset, BufferImage3D& image) -> CubeMapTexture&
auto setSubImage(Int level, const Vector3i& offset, BufferImage3D&& image) -> CubeMapTexture&
auto setCompressedSubImage(Int level, const Vector3i& offset, const CompressedImageView3D& image) -> CubeMapTexture&
Set compressed image subdata.
auto setCompressedSubImage(Int level, const Vector3i& offset, CompressedBufferImage3D& image) -> CubeMapTexture&
auto setCompressedSubImage(Int level, const Vector3i& offset, CompressedBufferImage3D&& image) -> CubeMapTexture&
auto setSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, const ImageView2D& image) -> CubeMapTexture&
Set image subdata.
auto setSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, BufferImage2D& image) -> CubeMapTexture&
auto setSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, BufferImage2D&& image) -> CubeMapTexture&
auto setCompressedSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, const CompressedImageView2D& image) -> CubeMapTexture&
Set compressed image subdata.
auto setCompressedSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, CompressedBufferImage2D& image) -> CubeMapTexture&
auto setCompressedSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, CompressedBufferImage2D&& image) -> CubeMapTexture&
auto generateMipmap() -> CubeMapTexture&
Generate mipmap.
void invalidateImage(Int level)
Invalidate texture image.
void invalidateSubImage(Int level, const Vector3i& offset, const Vector3i& size)
Invalidate texture subimage.

Typedef documentation

typedef CubeMapCoordinate Magnum::CubeMapTexture::Coordinate

Cube map coordinate.

Function documentation

static Vector2i Magnum::CubeMapTexture::maxSize()

Max supported size of one side of cube map texture.

The result is cached, repeated queries don't result in repeated OpenGL calls.

static Vector2i Magnum::CubeMapTexture::compressedBlockSize(TextureFormat format)

Compressed block size.

See Texture::compressedBlockSize() for more information.

static Int Magnum::CubeMapTexture::compressedBlockDataSize(TextureFormat format)

Compressed block data size.

See Texture::compressedBlockDataSize() for more information.

static CubeMapTexture Magnum::CubeMapTexture::wrap(GLuint id, ObjectFlags flags = {})

Wrap existing OpenGL cube map texture object.

Parameters
id OpenGL cube map texture ID
flags Object creation flags

The id is expected to be of an existing OpenGL texture object with target GL_TEXTURE_CUBE_MAP. Unlike texture created using constructor, the OpenGL object is by default not deleted on destruction, use flags for different behavior.

Magnum::CubeMapTexture::CubeMapTexture() explicit

Constructor.

Creates new OpenGL texture object. If ARB_direct_state_access (part of OpenGL 4.5) is not available, the texture is created on first use.

Magnum::CubeMapTexture::CubeMapTexture(NoCreateT) explicit noexcept

Construct without creating the underlying OpenGL object.

The constructed instance is equivalent to moved-from state. Useful in cases where you will overwrite the instance later anyway. Move another object over it to make it useful.

This function can be safely used for constructing (and later destructing) objects even without any OpenGL context being active.

void Magnum::CubeMapTexture::bindImage(Int imageUnit, Int level, CubeMapCoordinate coordinate, ImageAccess access, ImageFormat format)

Bind level of given cube map texture coordinate to given image unit.

Parameters
imageUnit Image unit
level Texture level
coordinate Cube map coordinate
access Image access
format Image format

void Magnum::CubeMapTexture::bindImageLayered(Int imageUnit, Int level, ImageAccess access, ImageFormat format)

Bind level of layered cube map texture to given image unit.

Parameters
imageUnit Image unit
level Texture level
access Image access
format Image format

CubeMapTexture& Magnum::CubeMapTexture::setBaseLevel(Int level)

Set base mip level.

Returns Reference to self (for method chaining)

See Texture::setBaseLevel() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setMaxLevel(Int level)

Set max mip level.

Returns Reference to self (for method chaining)

See Texture::setMaxLevel() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setMinificationFilter(Sampler::Filter filter, Sampler::Mipmap mipmap = Sampler::Mipmap::Base)

Set minification filter.

Returns Reference to self (for method chaining)

See Texture::setMinificationFilter() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setMagnificationFilter(Sampler::Filter filter)

Set magnification filter.

Returns Reference to self (for method chaining)

See Texture::setMagnificationFilter() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setMinLod(Float lod)

Set minimum level-of-detail parameter.

Returns Reference to self (for method chaining)

See Texture::setMinLod() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setMaxLod(Float lod)

Set maximum level-of-detail parameter.

Returns Reference to self (for method chaining)

See Texture::setMaxLod() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setLodBias(Float bias)

Set level-of-detail bias.

Returns Reference to self (for method chaining)

See Texture::setLodBias() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setWrapping(const Array2D<Sampler::Wrapping>& wrapping)

Set wrapping.

Returns Reference to self (for method chaining)

See Texture::setWrapping() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setBorderColor(const Color4& color)

Set border color.

Returns Reference to self (for method chaining)

See Texture::setBorderColor(const Color4&) for more information.

CubeMapTexture& Magnum::CubeMapTexture::setBorderColor(const Vector4ui& color)

Set border color for integer texture.

Returns Reference to self (for method chaining)

See Texture::setBorderColor(const Vector4ui&) for more information.

CubeMapTexture& Magnum::CubeMapTexture::setBorderColor(const Vector4i& color)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

CubeMapTexture& Magnum::CubeMapTexture::setMaxAnisotropy(Float anisotropy)

Set max anisotropy.

Returns Reference to self (for method chaining)

See Texture::setMaxAnisotropy() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setSRGBDecode(bool decode)

Set sRGB decoding.

Returns Reference to self (for method chaining)

See Texture::setSRGBDecode() for more information.

template<char r, char g, char b, char a>
CubeMapTexture& Magnum::CubeMapTexture::setSwizzle()

Set component swizzle.

Returns Reference to self (for method chaining)

See Texture::setSwizzle() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setCompareMode(Sampler::CompareMode mode)

Set depth texture comparison mode.

Returns Reference to self (for method chaining)

See Texture::setCompareMode() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setCompareFunction(Sampler::CompareFunction function)

Set depth texture comparison function.

Returns Reference to self (for method chaining)

See Texture::setCompareFunction() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setDepthStencilMode(Sampler::DepthStencilMode mode)

Set depth/stencil texture mode.

Returns Reference to self (for method chaining)

See Texture::setDepthStencilMode() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setStorage(Int levels, TextureFormat internalFormat, const Vector2i& size)

Set storage.

Returns Reference to self (for method chaining)

See Texture::setStorage() for more information.

Vector2i Magnum::CubeMapTexture::imageSize(Int level)

Image size in given mip level.

If ARB_direct_state_access (part of OpenGL 4.5) is not available, it is assumed that faces have the same size and just the size of Coordinate::PositiveX face is queried. See Texture::imageSize() for more information.

void Magnum::CubeMapTexture::image(Int level, Image3D& image)

Read given mip level of texture to image.

Image parameters like format and type of pixel data are taken from given image, image size is taken from the texture using imageSize(). The storage is not reallocated if it is large enough to contain the new data.

The operation is protected from buffer overflow.

Image3D Magnum::CubeMapTexture::image(Int level, Image3D&& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience alternative to the above, example usage:

Image3D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte});

void Magnum::CubeMapTexture::image(Int level, BufferImage3D& image, BufferUsage usage)

Read given mip level of texture to buffer image.

See image(Int, Image3D&) for more information. The storage is not reallocated if it is large enough to contain the new data, which means that usage might get ignored.

BufferImage3D Magnum::CubeMapTexture::image(Int level, BufferImage3D&& image, BufferUsage usage)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience alternative to the above, example usage:

BufferImage3D image = texture.image(0,
    {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);

void Magnum::CubeMapTexture::compressedImage(Int level, CompressedImage3D& image)

Read given mip level of compressed texture to image.

Compression format and data size are taken from the texture, image size is taken using imageSize(). The storage is not reallocated if it is large enough to contain the new data.

CompressedImage3D Magnum::CubeMapTexture::compressedImage(Int level, CompressedImage3D&& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience alternative to the above, example usage:

CompressedImage3D image = texture.compressedImage(0, {});

void Magnum::CubeMapTexture::compressedImage(Int level, CompressedBufferImage3D& image, BufferUsage usage)

Read given mip level of compressed texture to buffer image.

See compressedImage(Int, CompressedImage3D&) for more information. The storage is not reallocated if it is large enough to contain the new data, which means that usage might get ignored.

CompressedBufferImage3D Magnum::CubeMapTexture::compressedImage(Int level, CompressedBufferImage3D&& image, BufferUsage usage)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience alternative to the above, example usage:

CompressedBufferImage3D image = texture.compressedImage(0, {},
    BufferUsage::StaticRead);

void Magnum::CubeMapTexture::image(CubeMapCoordinate coordinate, Int level, Image2D& image)

Read given mip level and coordinate of texture to image.

Image parameters like format and type of pixel data are taken from given image, image size is taken from the texture using imageSize(). The storage is not reallocated if it is large enough to contain the new data.

If neither ARB_get_texture_sub_image (part of OpenGL 4.5) nor EXT_direct_state_access is available, the texture is bound before the operation (if not already). If either ARB_get_texture_sub_image or ARB_robustness is available, the operation is protected from buffer overflow. However, if ARB_get_texture_sub_image is not available and both EXT_direct_state_access and ARB_robustness are available, the robust operation is preferred over DSA.

Image2D Magnum::CubeMapTexture::image(CubeMapCoordinate coordinate, Int level, Image2D&& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience alternative to the above, example usage:

Image2D image = texture.image(CubeMapCoordinate::PositiveX, 0,
    {PixelFormat::RGBA, PixelType::UnsignedByte});

void Magnum::CubeMapTexture::image(CubeMapCoordinate coordinate, Int level, BufferImage2D& image, BufferUsage usage)

Read given mip level and coordinate of texture to buffer image.

See image(Coordinate, Int, Image2D&) for more information. The storage is not reallocated if it is large enough to contain the new data, which means that usage might get ignored.

BufferImage2D Magnum::CubeMapTexture::image(CubeMapCoordinate coordinate, Int level, BufferImage2D&& image, BufferUsage usage)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience alternative to the above, example usage:

BufferImage2D image = texture.image(CubeMapCoordinate::PositiveX, 0,
    {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);

void Magnum::CubeMapTexture::compressedImage(CubeMapCoordinate coordinate, Int level, CompressedImage2D& image)

Read given mip level and coordinate of compressed texture to image.

Compression format and data size are taken from the texture, image size is taken using imageSize(). The storage is not reallocated if it is large enough to contain the new data.

If neither ARB_get_texture_sub_image (part of OpenGL 4.5) nor EXT_direct_state_access is available, the texture is bound before the operation (if not already). If either ARB_get_texture_sub_image or ARB_robustness is available, the operation is protected from buffer overflow. However, if ARB_get_texture_sub_image is not available and both EXT_direct_state_access and ARB_robustness are available, the robust operation is preferred over DSA.

CompressedImage2D Magnum::CubeMapTexture::compressedImage(CubeMapCoordinate coordinate, Int level, CompressedImage2D&& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience alternative to the above, example usage:

CompressedImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX,
    0, {});

void Magnum::CubeMapTexture::compressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D& image, BufferUsage usage)

Read given mip level and coordinate of compressed texture to buffer image.

See compressedImage(Coordinate, Int, CompressedImage2D&) for more information. The storage is not reallocated if it is large enough to contain the new data, which means that usage might get ignored.

CompressedBufferImage2D Magnum::CubeMapTexture::compressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D&& image, BufferUsage usage)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience alternative to the above, example usage:

CompressedBufferImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX,
    0, {}, BufferUsage::StaticRead);

void Magnum::CubeMapTexture::subImage(Int level, const Range3Di& range, Image3D& image)

Read range of given texture mip level to image.

See Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, Image&) for more information.

Image3D Magnum::CubeMapTexture::subImage(Int level, const Range3Di& range, Image3D&& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience alternative to the above, example usage:

Image3D image = texture.subImage(0, range,
    {PixelFormat::RGBA, PixelType::UnsignedByte});

void Magnum::CubeMapTexture::subImage(Int level, const Range3Di& range, BufferImage3D& image, BufferUsage usage)

Read range of given texture mip level to buffer image.

See Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, BufferImage&, BufferUsage) for more information.

BufferImage3D Magnum::CubeMapTexture::subImage(Int level, const Range3Di& range, BufferImage3D&& image, BufferUsage usage)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience alternative to the above, example usage:

BufferImage3D image = texture.subImage(0, range,
    {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);

void Magnum::CubeMapTexture::compressedSubImage(Int level, const Range3Di& range, CompressedImage3D& image)

Read range of given compressed texture mip level to image.

See Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedImage&) for more information.

CompressedImage3D Magnum::CubeMapTexture::compressedSubImage(Int level, const Range3Di& range, CompressedImage3D&& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience alternative to the above, example usage:

CompressedImage3D image = texture.compressedSubImage(0, range, {});

void Magnum::CubeMapTexture::compressedSubImage(Int level, const Range3Di& range, CompressedBufferImage3D& image, BufferUsage usage)

Read range of given compressed texture mip level to buffer image.

See Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedBufferImage&, BufferUsage) for more information.

CompressedBufferImage3D Magnum::CubeMapTexture::compressedSubImage(Int level, const Range3Di& range, CompressedBufferImage3D&& image, BufferUsage usage)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience alternative to the above, example usage:

CompressedBufferImage3D image = texture.compressedSubImage(0, range, {},
    BufferUsage::StaticRead);

CubeMapTexture& Magnum::CubeMapTexture::setImage(CubeMapCoordinate coordinate, Int level, TextureFormat internalFormat, const ImageView2D& image)

Set image data.

Returns Reference to self (for method chaining)

See Texture::setImage() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setImage(CubeMapCoordinate coordinate, Int level, TextureFormat internalFormat, BufferImage2D& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

CubeMapTexture& Magnum::CubeMapTexture::setImage(CubeMapCoordinate coordinate, Int level, TextureFormat internalFormat, BufferImage2D&& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

CubeMapTexture& Magnum::CubeMapTexture::setCompressedImage(CubeMapCoordinate coordinate, Int level, const CompressedImageView2D& image)

Set compressed image data.

Returns Reference to self (for method chaining)

See Texture::setCompressedImage() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setCompressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

CubeMapTexture& Magnum::CubeMapTexture::setCompressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D&& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

CubeMapTexture& Magnum::CubeMapTexture::setSubImage(Int level, const Vector3i& offset, const ImageView3D& image)

Set image subdata.

Parameters
level Mip level
offset Offset where to put data in the texture
image Image3D, ImageView3D or Trade::ImageData3D
Returns Reference to self (for method chaining)

CubeMapTexture& Magnum::CubeMapTexture::setSubImage(Int level, const Vector3i& offset, BufferImage3D& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

CubeMapTexture& Magnum::CubeMapTexture::setSubImage(Int level, const Vector3i& offset, BufferImage3D&& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

CubeMapTexture& Magnum::CubeMapTexture::setCompressedSubImage(Int level, const Vector3i& offset, const CompressedImageView3D& image)

Set compressed image subdata.

Parameters
level Mip level
offset Offset where to put data in the texture
image CompressedImage3D, CompressedImageView3D or compressed Trade::ImageData3D
Returns Reference to self (for method chaining)

CubeMapTexture& Magnum::CubeMapTexture::setCompressedSubImage(Int level, const Vector3i& offset, CompressedBufferImage3D& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

CubeMapTexture& Magnum::CubeMapTexture::setCompressedSubImage(Int level, const Vector3i& offset, CompressedBufferImage3D&& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

CubeMapTexture& Magnum::CubeMapTexture::setSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, const ImageView2D& image)

Set image subdata.

Returns Reference to self (for method chaining)

See Texture::setSubImage() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, BufferImage2D& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

CubeMapTexture& Magnum::CubeMapTexture::setSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, BufferImage2D&& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

CubeMapTexture& Magnum::CubeMapTexture::setCompressedSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, const CompressedImageView2D& image)

Set compressed image subdata.

Returns Reference to self (for method chaining)

See Texture::setCompressedSubImage() for more information.

CubeMapTexture& Magnum::CubeMapTexture::setCompressedSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, CompressedBufferImage2D& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

CubeMapTexture& Magnum::CubeMapTexture::setCompressedSubImage(CubeMapCoordinate coordinate, Int level, const Vector2i& offset, CompressedBufferImage2D&& image)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

CubeMapTexture& Magnum::CubeMapTexture::generateMipmap()

Generate mipmap.

Returns Reference to self (for method chaining)

See Texture::generateMipmap() for more information.

void Magnum::CubeMapTexture::invalidateImage(Int level)

Invalidate texture image.

See Texture::invalidateImage() for more information.

void Magnum::CubeMapTexture::invalidateSubImage(Int level, const Vector3i& offset, const Vector3i& size)

Invalidate texture subimage.

Z coordinate is equivalent to number of texture face, i.e. Coordinate::PositiveX is 0 and so on, in the same order as in the enum.

See Texture::invalidateSubImage() for more information.