8#include <utility/graphic/material.hpp>
10#include <utility/ressource_provider.hpp>
12namespace utility::graphic
15 const std::string &shaderName,
16 const std::vector<File> &textureAssets)
17 : _shaderName(shaderName)
20 for (
const auto &textureAsset: textureAssets) {
22 std::make_shared<File>(textureAsset));
25 throw std::runtime_error(
"Failed to load texture asset: "
26 + textureAsset.path());
44 std::vector<std::shared_ptr<Texture>> textures;
46 for (
const auto &[_, texture]:
_textures) {
47 textures.push_back(texture);
The RessourceProvider class is responsible for managing and loading various resources such as fonts,...
std::shared_ptr< graphic::Texture > loadTextureFromAsset(std::shared_ptr< utility::File > textureAsset)
Loads a texture resource from a specified asset.
std::string _shaderName
The name of the shader associated with this material.
Material()=default
Constructs an empty Material.
std::map< std::string, std::shared_ptr< Texture > > _textures
A map of texture names to Texture objects associated with this material.
AlphaMode getAlphaMode(void) const
Retrieves the alpha semantics of this material.
float _alphaCutoff
The alpha cutoff, only meaningful for AlphaMode::Mask.
const std::string & getShaderName() const
Retrieves the shader name associated with this material.
uint32_t _version
A version number for the material, used for tracking changes and updates.
std::shared_ptr< Texture > getTexture(const std::string &name) const
Retrieves a texture by its name.
std::vector< std::shared_ptr< Texture > > getTextures() const
Retrieves the textures associated with this material.
AlphaMode _alphaMode
The alpha semantics of this material.
uint32_t getVersion() const
Retrieves the version number of the material.
float getAlphaCutoff(void) const
Retrieves the alpha cutoff of this material.