MOS
Public Member Functions | List of all members
mos::gfx::Assets Class Referencefinal

Cache for faster loading of textures and meshes. More...

#include <assets.hpp>

Public Member Functions

 Assets (std::string directory="assets/")
 
 Assets (const Assets &assets)=delete
 
 Assets (const Assets &&assets)=delete
 
Assetsoperator= (const Assets &assets)=delete
 
Assetsoperator= (const Assets &&assets)=delete
 
auto mesh (const std::string &path) -> Shared_mesh
 Loads a Mesh from a *.mesh file and caches it internally. More...
 
auto texture (const std::string &path, bool color_data=true, bool mipmaps=true, const Texture_2D::Filter &filter=Texture_2D::Filter::Linear, const Texture_2D::Wrap &wrap=Texture_2D::Wrap::Repeat) -> Shared_texture_2D
 Loads Texture2D from a *.png file or *.texture and caches it internally.
 
auto clear_unused () -> void
 Remove all unused assets. More...
 
auto clear () -> void
 Clear all assets. More...
 
auto directory () const -> std::string
 Parent directory of the cache. More...
 

Detailed Description

Cache for faster loading of textures and meshes.

Constructor & Destructor Documentation

◆ Assets()

mos::gfx::Assets::Assets ( std::string  directory = "assets/")
explicit
Parameters
directoryThe directory where the assets exist, relative to the run directory.

Member Function Documentation

◆ clear()

auto mos::gfx::Assets::clear ( ) -> void

Clear all assets.

◆ clear_unused()

auto mos::gfx::Assets::clear_unused ( ) -> void

Remove all unused assets.

◆ directory()

auto mos::gfx::Assets::directory ( ) const -> std::string

Parent directory of the cache.

◆ mesh()

auto mos::gfx::Assets::mesh ( const std::string &  path) -> Shared_mesh

Loads a Mesh from a *.mesh file and caches it internally.


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