Wraps an OpenGL texture object.
Definition texture.hpp:12
void load()
Loads the image at path into GPU memory.
Definition texture.cpp:72
void bind()
Binds this texture for sampling.
Definition texture.cpp:64
std::string path
Definition texture.hpp:15
void unbind()
Unbinds the current texture.
Definition texture.cpp:68
void createFromBuffer(int width, int height, unsigned char *data, bool mono=false)
Creates a texture from a raw pixel buffer.
Definition texture.cpp:17
unsigned int ID
OpenGL texture object handle.
Definition texture.hpp:14
Texture()
Constructs an empty texture without loading any data.
Definition texture.cpp:8
void update(std::string path)
Replaces the texture's source image and reloads it.
Definition texture.cpp:58