AireEngine
A 3D Open-World Game Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Aire::MaterialManager Class Reference

Material manager. Handles material creation, storage, and deletion. More...

#include <matManager.h>

Public Member Functions

 MaterialManager (const MaterialManager &)=delete
 
MaterialManageroperator= (const MaterialManager &)=delete
 
MatHandle createMaterial ()
 
MatHandle createMaterial (std::string &diffusePath, std::string &specularPath, std::string &normalPath, std::string &heightPath, bool isflipped)
 
MatHandle createMaterial (std::string Name)
 
MaterialPtr getMaterialPtr (MatHandle &)
 
MaterialPtr getMaterialPtrByName (std::string &name)
 
void setMatererialInGPU (MaterialPtr &)
 
void freeMaterialInGPU (MaterialPtr &)
 
void freeMaterialInCPU (MaterialPtr &)
 

Static Public Member Functions

static MaterialManagerget_instance ()
 

Detailed Description

Material manager. Handles material creation, storage, and deletion.

Member Function Documentation

◆ createMaterial() [1/3]

MatHandle MaterialManager::createMaterial ( )

Create a default material NOTE: DO NOT call delete on returned pointer. The associated texture will be automatically deleted when the loader goes out of scope.

Returns
A handle to the new material

◆ createMaterial() [2/3]

MatHandle Aire::MaterialManager::createMaterial ( std::string & diffusePath,
std::string & specularPath,
std::string & normalPath,
std::string & heightPath,
bool isflipped )

Create a custom new material NOTE: DO NOT call delete on returned pointer. The associated texture will be automatically deleted when the loader goes out of scope.

Parameters
diffusePathPath to the diffuse texture
specularPathPath to the specular texture
normalPathPath to the normal texture
heightPathPath to a heightmap texture
isFlippedTrue if the textures should be vertically flipped on load
Returns
A handle to the new material

◆ createMaterial() [3/3]

MatHandle Aire::MaterialManager::createMaterial ( std::string Name)

Create a default material identified by a custom name NOTE: DO NOT call delete on returned pointer. The associated texture will be automatically deleted when the loader goes out of scope.

Parameters
NameThe name to associate with the new material
Returns
A handle to the new material

◆ freeMaterialInCPU()

void Aire::MaterialManager::freeMaterialInCPU ( MaterialPtr & mat)

Remove a material object from CPU memory

Parameters
matPointer to the material

◆ freeMaterialInGPU()

void Aire::MaterialManager::freeMaterialInGPU ( MaterialPtr & mat)

Remove a material object from GPU memory

Parameters
matPointer to the material

◆ getMaterialPtr()

MaterialPtr Aire::MaterialManager::getMaterialPtr ( MatHandle & handle)

Get pointer to a given material identified by a handle

Parameters
handleHandle to a material object
Returns
A pointer to the material referenced by the handle

◆ getMaterialPtrByName()

MaterialPtr Aire::MaterialManager::getMaterialPtrByName ( std::string & name)

Get pointer to a material identified by a name

Parameters
nameThe name of the material to query for
Returns
A pointer to the material identified with the name

◆ setMatererialInGPU()

void Aire::MaterialManager::setMatererialInGPU ( MaterialPtr & mat)

Send the material to GPU memory

Parameters
matPointer to the material

The documentation for this class was generated from the following files: