41 throw std::runtime_error(
"Failed to get texture with type " + std::to_string(
static_cast<int>(type)));
61 CORE_DEBUG(fileName <<
": " << texture->width <<
"x" << texture->height <<
"x" << (
int)texture->channels <<
"x"
62 << (
int)texture->depth <<
" added to the texture cache");
74 throw std::runtime_error(
"Failed to load texture from " + fileName);
void markModified(const bool triggerCallback=true)
static Texture2DPtr importTextureFromFile(const std::string &filename, const TextureType type)
Import a Texture from file.
TextureDescriptors _textureDescriptors
PLATFORM_API void removeTexture(const TextureType type)
Removes the texture of the material for the specified texture type.
bool _loadTexture(const std::string &fileName, const TextureType type)
Loads the texture for the specified texture type.
PLATFORM_API void setTexture(const std::string &fileName, const TextureType type)
Sets the texture of the material for the specified texture type.
PLATFORM_API Texture2DPtr getTexture(const TextureType type) const
Returns the texture of the material for the specified texture type.
PLATFORM_API void clearTextures()
Clears all textures from the material object.
PLATFORM_API Material(const PropertyMap &properties={})
Constructs a Material object.
void setCurrentType(const std::string &type)
std::map< std::string, PropertyMap > _properties
std::shared_ptr< Texture2D > Texture2DPtr