matf-rg-engine 1.0.0
Base for project for the Computer Graphics course at Faculty of Mathematics, University of Belgrade
|
Represents a texture object within the OpenGL context. More...
#include <Texture.hpp>
Public Member Functions | |
void | destroy () |
Destroys the texture object in the OpenGL context. | |
TextureType | type () const |
Returns the type of the texture. | |
uint32_t | id () const |
Returns the OpenGL ID of the texture. | |
void | bind (int32_t sampler) |
Binds the texture to a given sampler. | |
const std::filesystem::path & | path () const |
Returns the path to the texture file from which the texture was loaded. | |
const std::string & | name () const |
Returns the name of the texture by which it can be referenced using the engine::resources::ResourcesController::texture function. | |
Texture ()=default | |
Static Public Member Functions | |
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 class to bind the texture to the correct uniform sampler by name. | |
Private Member Functions | |
Texture (uint32_t id, TextureType type, std::filesystem::path path, std::string name) | |
Constructs a Texture object. | |
Private Attributes | |
uint32_t | m_id {} |
TextureType | m_type {} |
std::filesystem::path | m_path {} |
std::string | m_name {} |
Friends | |
class | ResourcesController |
Represents a texture object within the OpenGL context.
|
default |
|
inlineprivate |
Constructs a Texture object.
id | The OpenGL ID of the texture. |
type | The type of the texture. |
path | The path to the texture file. |
name | The name of the texture. |
|
static |
Returns the uniform name convention for a given texture type. The convention is used by the Model class to bind the texture to the correct uniform sampler by name.
type | The type of the texture. |
void engine::resources::Texture::destroy | ( | ) |
Destroys the texture object in the OpenGL context.
|
inline |
Returns the type of the texture.
|
inline |
Returns the OpenGL ID of the texture.
void engine::resources::Texture::bind | ( | int32_t | sampler | ) |
Binds the texture to a given sampler.
sampler | The sampler to bind the texture to. |
|
inline |
Returns the path to the texture file from which the texture was loaded.
|
inline |
Returns the name of the texture by which it can be referenced using the engine::resources::ResourcesController::texture function.
|
friend |
|
private |
|
private |
|
private |
|
private |