Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 783 Bytes

texture_data.md

File metadata and controls

46 lines (30 loc) · 783 Bytes

Holds the data required to load a texture.

Members

Attributes

void * data = nullptr;
int width = 0;
int height = 0;
int components = 0;

The loaded texture data.

Constructors

texture_data(const char * file) noexcept;

Loads the data from file.

texture_data(const void * data, unsigned int width, unsigned int height) noexcept;

Loads the data from memory (uncompressing it if necessary).

load_to_texture

texture load_to_texture() const noexcept;

Loads the data into an OpenGL texture.

is_supported_format

static bool is_supported_format(const char * file) noexcept;

Returns whether file is a supported image type.