Represents a texture object within the OpenGL context.
Definition Texture.hpp:31
TextureType m_type
Definition Texture.hpp:111
const std::filesystem::path & path() const
Returns the path to the texture file from which the texture was loaded.
Definition Texture.hpp:81
const std::string & name() const
Returns the name of the texture by which it can be referenced using the engine::resources::ResourcesC...
Definition Texture.hpp:89
TextureType type() const
Returns the type of the texture.
Definition Texture.hpp:59
static std::string_view uniform_name_convention(TextureType type)
Returns the uniform name convention for a given texture type. The convention is used by the Model cla...
Definition Texture.cpp:26
void destroy()
Destroys the texture object in the OpenGL context.
Definition Texture.cpp:16
Texture(uint32_t id, TextureType type, std::filesystem::path path, std::string name)
Constructs a Texture object.
Definition Texture.hpp:103
uint32_t m_id
Definition Texture.hpp:110
uint32_t id() const
Returns the OpenGL ID of the texture.
Definition Texture.hpp:67
std::string m_name
Definition Texture.hpp:113
std::filesystem::path m_path
Definition Texture.hpp:112
void bind(int32_t sampler)
Binds the texture to a given sampler.
Definition Texture.cpp:20