SLProject 4.0.000
SLAssetManager Class Reference

Toplevel holder of the assets meshes, materials, textures and shaders. More...

#include <SLAssetManager.h>

Public Member Functions

 SLAssetManager (SLstring fontPath="", bool generateStaticFonts=false)
 
 ~SLAssetManager ()
 
void clear ()
 for all assets, clear gpu data More...
 
void deleteDataGpu ()
 for all assets, clear gpu data More...
 
bool removeMesh (SLMesh *mesh)
 Removes the specified mesh from the meshes resource vector. More...
 
SLGLProgramgetProgramByName (const string &programName)
 Returns the pointer to shader program if found by name. More...
 
void merge (SLAssetManager &other)
 merge other asset manager into this More...
 
SLVMeshmeshes ()
 
SLVMaterialmaterials ()
 
SLVGLTexturetextures ()
 
SLVGLProgramprograms ()
 

Static Public Member Functions

static void generateFonts (SLstring fontPath, SLGLProgram &fontTexProgram)
 Generates all static fonts. More...
 
static void deleteFonts ()
 Deletes all static fonts. More...
 
static SLTexFontgetFont (SLfloat heightMM, SLint dpi)
 returns nearest font for a given height in mm More...
 

Static Public Attributes

static SLTexFontfont07 = nullptr
 7 pixel high fixed size font More...
 
static SLTexFontfont08 = nullptr
 8 pixel high fixed size font More...
 
static SLTexFontfont09 = nullptr
 9 pixel high fixed size font More...
 
static SLTexFontfont10 = nullptr
 10 pixel high fixed size font More...
 
static SLTexFontfont12 = nullptr
 12 pixel high fixed size font More...
 
static SLTexFontfont14 = nullptr
 14 pixel high fixed size font More...
 
static SLTexFontfont16 = nullptr
 16 pixel high fixed size font More...
 
static SLTexFontfont18 = nullptr
 18 pixel high fixed size font More...
 
static SLTexFontfont20 = nullptr
 20 pixel high fixed size font More...
 
static SLTexFontfont22 = nullptr
 22 pixel high fixed size font More...
 
static SLTexFontfont24 = nullptr
 24 pixel high fixed size font More...
 

Protected Attributes

SLVMesh _meshes
 Vector of all meshes. More...
 
SLVMaterial _materials
 Vector of all materials pointers. More...
 
SLVGLTexture _textures
 Vector of all texture pointers. More...
 
SLVGLProgram _programs
 Vector of all shader program pointers. More...
 

Detailed Description

Toplevel holder of the assets meshes, materials, textures and shaders.

All these assets can be shared among instances of SLScene, SLNode and SLMaterial. Shared assets are meshes (SLMesh), materials (SLMaterial), textures (SLGLTexture) and shader programs (SLGLProgram). One instance of SLAssetManager must be owned and destroyed by the app (see e.g. AppDemo.h).

Constructor & Destructor Documentation

◆ SLAssetManager()

SLAssetManager::SLAssetManager ( SLstring  fontPath = "",
bool  generateStaticFonts = false 
)
inline

◆ ~SLAssetManager()

SLAssetManager::~SLAssetManager ( )

Member Function Documentation

◆ clear()

void SLAssetManager::clear ( )

for all assets, clear gpu data

◆ deleteDataGpu()

void SLAssetManager::deleteDataGpu ( )

for all assets, clear gpu data

◆ deleteFonts()

void SLAssetManager::deleteFonts ( )
static

Deletes all static fonts.

◆ generateFonts()

void SLAssetManager::generateFonts ( SLstring  fontPath,
SLGLProgram fontTexProgram 
)
static

Generates all static fonts.

◆ getFont()

SLTexFont * SLAssetManager::getFont ( SLfloat  heightMM,
SLint  dpi 
)
static

returns nearest font for a given height in mm

◆ getProgramByName()

SLGLProgram * SLAssetManager::getProgramByName ( const string &  programName)

Returns the pointer to shader program if found by name.

◆ materials()

SLVMaterial & SLAssetManager::materials ( )
inline

◆ merge()

void SLAssetManager::merge ( SLAssetManager other)

merge other asset manager into this

◆ meshes()

SLVMesh & SLAssetManager::meshes ( )
inline

◆ programs()

SLVGLProgram & SLAssetManager::programs ( )
inline

◆ removeMesh()

bool SLAssetManager::removeMesh ( SLMesh mesh)

Removes the specified mesh from the meshes resource vector.

◆ textures()

SLVGLTexture & SLAssetManager::textures ( )
inline

Member Data Documentation

◆ _materials

SLVMaterial SLAssetManager::_materials
protected

Vector of all materials pointers.

◆ _meshes

SLVMesh SLAssetManager::_meshes
protected

Vector of all meshes.

◆ _programs

SLVGLProgram SLAssetManager::_programs
protected

Vector of all shader program pointers.

◆ _textures

SLVGLTexture SLAssetManager::_textures
protected

Vector of all texture pointers.

◆ font07

SLTexFont * SLAssetManager::font07 = nullptr
static

7 pixel high fixed size font

◆ font08

SLTexFont * SLAssetManager::font08 = nullptr
static

8 pixel high fixed size font

◆ font09

SLTexFont * SLAssetManager::font09 = nullptr
static

9 pixel high fixed size font

◆ font10

SLTexFont * SLAssetManager::font10 = nullptr
static

10 pixel high fixed size font

◆ font12

SLTexFont * SLAssetManager::font12 = nullptr
static

12 pixel high fixed size font

◆ font14

SLTexFont * SLAssetManager::font14 = nullptr
static

14 pixel high fixed size font

◆ font16

SLTexFont * SLAssetManager::font16 = nullptr
static

16 pixel high fixed size font

◆ font18

SLTexFont * SLAssetManager::font18 = nullptr
static

18 pixel high fixed size font

◆ font20

SLTexFont * SLAssetManager::font20 = nullptr
static

20 pixel high fixed size font

◆ font22

SLTexFont * SLAssetManager::font22 = nullptr
static

22 pixel high fixed size font

◆ font24

SLTexFont * SLAssetManager::font24 = nullptr
static

24 pixel high fixed size font


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