5 #include <unordered_map> 9 #include <mos/gfx/character.hpp> 10 #include <mos/gfx/environment_light.hpp> 11 #include <mos/gfx/font.hpp> 12 #include <mos/gfx/mesh.hpp> 13 #include <mos/gfx/model.hpp> 14 #include <mos/gfx/spot_light.hpp> 15 #include <mos/gfx/texture_2d.hpp> 33 auto mesh(
const std::string &path) -> Shared_mesh;
37 auto texture(
const std::string &path,
bool color_data =
true,
39 const Texture_2D::Filter &filter = Texture_2D::Filter::Linear,
40 const Texture_2D::Wrap &wrap = Texture_2D::Wrap::Repeat)
53 using Meshes = std::unordered_map<std::string, Shared_mesh>;
54 using Textures = std::unordered_map<std::string, Shared_texture_2D>;
56 const std::string directory_;
Assets(std::string directory="assets/")
auto mesh(const std::string &path) -> Shared_mesh
Loads a Mesh from a *.mesh file and caches it internally.
Cache for faster loading of textures and meshes.
Definition: assets.hpp:20
Definition: assets.hpp:17
auto clear_unused() -> void
Remove all unused assets.
auto directory() const -> std::string
Parent directory of the cache.
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() -> void
Clear all assets.