const std::string & name() const
Get the name of the texture.
Definition texture.h:91
FilterMode filter_mode() const
Get the filter mode of the texture.
Definition texture.h:125
FilterMode
The filter mode of the texture.
Definition texture.h:50
@ NEAREST
Nearest neighbor interpolation.
Definition texture.h:51
void release() const
Release the texture.
Definition texture.cpp:190
int channels() const
Get the number of channels of the texture.
Definition texture.h:115
void bind(int unit=0) const
Bind the texture to a texture unit.
Definition texture.cpp:184
WrapMode
The wrap mode of the texture.
Definition texture.h:45
@ REPEAT
Repeat the texture coordinate.
Definition texture.h:47
@ CLAMP_TO_EDGE
Clamp the texture coordinate to the range [0, 1].
Definition texture.h:46
int height() const
Get the height of the texture.
Definition texture.h:110
int width() const
Get the width of the texture.
Definition texture.h:105
~Texture()
Destructor.
Definition texture.cpp:45
WrapMode wrap_mode() const
Get the wrap mode of the texture.
Definition texture.h:120
unsigned int id() const
Get the OpenGL texture ID.
Definition texture.h:86
static Texture * create(const std::string &image_file, WrapMode wrap=CLAMP_TO_EDGE, FilterMode filter=LINEAR)
Creates a texture from an image file.
Definition texture.cpp:53
Management of OpenGL textures.
Definition texture_manager.h:53
void discretize_image(std::vector< unsigned char > &data, int width, int height, int channels, int num_stripes)
Discretize a gradually varying-color (from left to right) image into a set of uniform colored vertica...
Definition texture.cpp:196