AUI Framework
develop
Cross-platform base for C++ UI apps
|
Represents a 2D texture array. More...
#include <AUI/GL/Texture2DArray.h>
A 2D texture array is a texture that contains multiple 2D textures, each accessible by its index. It's useful for storing and accessing multiple textures with the same dimensions.
After creating a 2D texture array, you can use update
to update a single texture in the array. You cannot update dimensions of the texture array, so you should create a new one if you want to change the size of the texture array.
gl::Texture2DArray::Texture2DArray | ( | glm::uvec2 | textureSize, |
unsigned | textureCount ) |
textureSize | The size of the 2D texture (width and height). |
textureCount | The number of layers in the texture array. |
This function allocates storage for a 2D texture array with the specified size and texture count. It binds the texture and uses glTexStorage3D
to allocate the storage.
> All members, including inherited
void gl::Texture2DArray::update | ( | unsigned | texture, |
AImageView | image ) |
texture | The index of the texture to be updated. |
image | The image to be used as the new texture. |
This function binds the texture and uploads the provided image as a texture in the 2D texture array. It uses glTexSubImage3D
to update the texture.
This function expects the image to have the same size as the texture size initialized earlier, otherwise, an assertion error is thrown.
Contents