Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
Public Member Functions | Public Attributes | Private Attributes | Friends | List of all members
cqsp::asset::AssetManager Class Reference

#include <assetmanager.h>

Public Member Functions

 AssetManager ()=default
 
ShaderProgram_t MakeShader (const std::string &vert, const std::string &frag)
 
ShaderProgram_t MakeShader (const std::string &vert, const std::string &frag, const std::string &geom)
 
template<class T >
T * GetAsset (const std::string &key)
 Gets an asset. More...
 
void LoadDefaultTexture ()
 
void ClearAssets ()
 
PackageGetPackage (const std::string &name)
 
int GetPackageCount ()
 
auto begin ()
 
auto end ()
 
void SaveModList ()
 

Public Attributes

std::map< std::string, PackagePrototypem_package_prototype_list
 

Private Attributes

std::map< std::string, std::unique_ptr< Package > > packages
 
asset::Texture empty_texture
 

Friends

class AssetLoader
 

Constructor & Destructor Documentation

◆ AssetManager()

cqsp::asset::AssetManager::AssetManager ( )
default

Member Function Documentation

◆ begin()

auto cqsp::asset::AssetManager::begin ( )
inline

◆ ClearAssets()

void cqsp::asset::AssetManager::ClearAssets ( )

◆ end()

auto cqsp::asset::AssetManager::end ( )
inline

◆ GetAsset()

template<class T >
T * cqsp::asset::AssetManager::GetAsset ( const std::string &  key)
inline

Gets an asset.

To get an asset, it defaults finding the asset in core if you do not specify a package, or else if the asset is from another asset pack, you can specify mod_name:asset_name, the separator between the two being a colon.

Template Parameters
TThe type class
Parameters
key
Returns

◆ GetPackage()

Package * cqsp::asset::AssetManager::GetPackage ( const std::string &  name)
inline

◆ GetPackageCount()

int cqsp::asset::AssetManager::GetPackageCount ( )
inline

◆ LoadDefaultTexture()

void cqsp::asset::AssetManager::LoadDefaultTexture ( )

◆ MakeShader() [1/2]

ShaderProgram_t cqsp::asset::AssetManager::MakeShader ( const std::string &  vert,
const std::string &  frag 
)

◆ MakeShader() [2/2]

ShaderProgram_t cqsp::asset::AssetManager::MakeShader ( const std::string &  vert,
const std::string &  frag,
const std::string &  geom 
)

◆ SaveModList()

void cqsp::asset::AssetManager::SaveModList ( )

Friends And Related Function Documentation

◆ AssetLoader

friend class AssetLoader
friend

Member Data Documentation

◆ empty_texture

asset::Texture cqsp::asset::AssetManager::empty_texture
private

◆ m_package_prototype_list

std::map<std::string, PackagePrototype> cqsp::asset::AssetManager::m_package_prototype_list

◆ packages

std::map<std::string, std::unique_ptr<Package> > cqsp::asset::AssetManager::packages
private

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