cubos::core::gl::impl::Texture2D class

Abstract 2D texture.

Public functions

void update(std::size_t x, std::size_t y, std::size_t width, std::size_t height, const void* data, std::size_t level = 0) pure virtual
Updates the texture with new data, which must have the same format used when the texture was created.
void read(void* outputBuffer, std::size_t level = 0) pure virtual
Reads texture data into a buffer, which must have the same format used when the texture was created.
void copyTo(gl::PixelPackBuffer buffer, std::size_t level = 0) pure virtual
Copies part of the texture data into a pixel pack buffer.
void generateMipmaps() pure virtual
Generates mipmaps on this texture.

Function documentation

void cubos::core::gl::impl::Texture2D::update(std::size_t x, std::size_t y, std::size_t width, std::size_t height, const void* data, std::size_t level = 0) pure virtual

Updates the texture with new data, which must have the same format used when the texture was created.

Parameters
x Destination X coordinate.
y Destination Y coordinate.
width Width of the section which will be updated.
height Height of the section which will be updated.
data Pointer to the new data.
level Mip level to update.

void cubos::core::gl::impl::Texture2D::read(void* outputBuffer, std::size_t level = 0) pure virtual

Reads texture data into a buffer, which must have the same format used when the texture was created.

Parameters
outputBuffer Buffer to write the data to.
level Mip level to read.

void cubos::core::gl::impl::Texture2D::copyTo(gl::PixelPackBuffer buffer, std::size_t level = 0) pure virtual

Copies part of the texture data into a pixel pack buffer.

Parameters
buffer Buffer to copy into.
level Mip level to copy.