Clutter Engine 0.0.1
|
Asset management class for textures, meshes, fonts, and shaders. More...
#include <Assets.h>
Public Member Functions | |
void | SetRenderer (IRenderer *pRenderer) |
Sets the renderer and loads engine assets. | |
Texture * | LoadTexture (const std::string &pPath, const std::string &pName, TextureFilter pTexFilter=TextureFilter::LINEAR, bool generateMipMaps=true) |
Loads a texture from file. | |
std::vector< Texture * > | BulkLoadTexture (const std::string &pPath, int pLastIndex, const std::string &pFileName, const std::string &pName, TextureFilter pTexFilter=TextureFilter::LINEAR, bool pMipMap=true) |
Loads multiple textures in bulk. | |
Mesh * | LoadMesh (const std::string &pPath, const std::string &pName, std::vector< Texture * > pTextures={}, bool pTesselate=false) |
Loads a mesh with textures. | |
Mesh * | LoadMesh (const std::string &pPath, const std::string &pName, const std::string &pTexture, bool pTesselate=false) |
Loads a mesh with a single texture. | |
Mesh * | LoadMesh (const std::string &pPath, const std::string &pName, bool pTesselate) |
Loads a mesh. | |
Mesh * | LoadMesh (const std::string &pPath, const std::string &pName, ShaderProgram *pShader, std::vector< Texture * > pTextures, bool pTesselate=false) |
Loads a mesh with a shader and textures. | |
Mesh * | LoadMesh (const std::string &pPath, const std::string &pName, ShaderProgram *pShader, bool pTesselate=false) |
Loads a mesh with a shader. | |
Font * | LoadFont (const std::string &pPath, const std::string &pName, GLuint pFontSize=128) |
Loads a font from file. | |
Shader * | LoadShader (const std::string &pPath, ShaderType pType) |
Loads a shader from file. | |
Texture * | GetTexture (const std::string &pName) |
Gets a loaded texture by name. | |
std::vector< Texture * > | BulkGetTexture (const std::string &pName, int pLastIndex) |
Gets multiple textures by name pattern. | |
Mesh * | GetMesh (const std::string &pName, bool pTesselate=false) |
Gets a loaded mesh by name. | |
Font * | GetFont (const std::string &pName) |
Gets a loaded font by name. | |
Shader * | GetShader (const std::string &pName, ShaderType pType) |
Gets a loaded shader by name and type. | |
void | ClearAssets () |
Clears all loaded assets. | |
Static Public Member Functions | |
static Assets & | Get () |
Gets the singleton instance of Assets. | |
Asset management class for textures, meshes, fonts, and shaders.
Handles loading, storing, and retrieving engine assets.
std::vector< Texture * > Assets::BulkGetTexture | ( | const std::string & | pName, |
int | pLastIndex ) |
Gets multiple textures by name pattern.
pName | Name pattern |
pLastIndex | Last index |
std::vector< Texture * > Assets::BulkLoadTexture | ( | const std::string & | pPath, |
int | pLastIndex, | ||
const std::string & | pFileName, | ||
const std::string & | pName, | ||
TextureFilter | pTexFilter = TextureFilter::LINEAR, | ||
bool | pMipMap = true ) |
|
static |
Font * Assets::GetFont | ( | const std::string & | pName | ) |
Mesh * Assets::GetMesh | ( | const std::string & | pName, |
bool | pTesselate = false ) |
Gets a loaded mesh by name.
pName | Name of the mesh |
pTesselate | Whether to get tesselated version |
Shader * Assets::GetShader | ( | const std::string & | pName, |
ShaderType | pType ) |
Texture * Assets::GetTexture | ( | const std::string & | pName | ) |
Font * Assets::LoadFont | ( | const std::string & | pPath, |
const std::string & | pName, | ||
GLuint | pFontSize = 128 ) |
Mesh * Assets::LoadMesh | ( | const std::string & | pPath, |
const std::string & | pName, | ||
bool | pTesselate ) |
Loads a mesh.
pPath | Path to mesh file |
pName | Name to store the mesh as |
pTesselate | Whether to tesselate the mesh |
Mesh * Assets::LoadMesh | ( | const std::string & | pPath, |
const std::string & | pName, | ||
const std::string & | pTexture, | ||
bool | pTesselate = false ) |
Loads a mesh with a single texture.
pPath | Path to mesh file |
pName | Name to store the mesh as |
pTexture | Name of texture to apply |
pTesselate | Whether to tesselate the mesh |
Mesh * Assets::LoadMesh | ( | const std::string & | pPath, |
const std::string & | pName, | ||
ShaderProgram * | pShader, | ||
bool | pTesselate = false ) |
Mesh * Assets::LoadMesh | ( | const std::string & | pPath, |
const std::string & | pName, | ||
ShaderProgram * | pShader, | ||
std::vector< Texture * > | pTextures, | ||
bool | pTesselate = false ) |
Mesh * Assets::LoadMesh | ( | const std::string & | pPath, |
const std::string & | pName, | ||
std::vector< Texture * > | pTextures = {}, | ||
bool | pTesselate = false ) |
Loads a mesh with textures.
pPath | Path to mesh file |
pName | Name to store the mesh as |
pTextures | Textures to apply |
pTesselate | Whether to tesselate the mesh |
Shader * Assets::LoadShader | ( | const std::string & | pPath, |
ShaderType | pType ) |
Texture * Assets::LoadTexture | ( | const std::string & | pPath, |
const std::string & | pName, | ||
TextureFilter | pTexFilter = TextureFilter::LINEAR, | ||
bool | generateMipMaps = true ) |
|
inline |
Sets the renderer and loads engine assets.
pRenderer | Renderer to use |