CoriEngine
Loading...
Searching...
No Matches
AssetManager.cpp
Go to the documentation of this file.
1#include "AssetManager.hpp"
2#include "Graphics/Font.hpp"
5
6namespace Cori {
7 AssetManager::Cache* AssetManager::s_Cache = nullptr;
8
9 void AssetManager::Init() {
10 s_Cache = new Cache();
11 RegisterPlaceholders();
12 }
13
14 void AssetManager::Shutdown() {
15 delete s_Cache;
16 }
17
18 void AssetManager::RegisterPlaceholders() {
21
22 const auto tp = Graphics::Texture2D::Create(Graphics::Image::Create(FileSystem::PathManager::GetAliasedPath("ENGINE_DATA") / "placeholders/missing_texture32.png"));
24 }
25}
static void RegisterPlaceholder(const std::shared_ptr< AssetType > &placeholderInstance)
This allows you to register a placeholder for a specific asset that you can later retrieve.
static std::filesystem::path GetAliasedPath(const std::string &alias)
Retries the full aliased path defined in fsgame.json.
static std::shared_ptr< Font > Create(const std::filesystem::path &path, const std::vector< CharsetRange > &charsets, const float minimalScale=48.0f, const float miterLimit=1.0f)
Creates a Font object.
Definition Font.cpp:9
static std::shared_ptr< Image > Create(const std::filesystem::path &path)
Creates an Image from the picture at the specified path.
Definition Image.cpp:189
static std::shared_ptr< Texture2D > Create(const std::shared_ptr< Image > &image)
Creates a Texture2D from the Image.
Definition Texture.cpp:7
Global engine namespace.
static constexpr CharsetRange Latin
Definition Font.hpp:30
static constexpr CharsetRange LatinExtendedA
Definition Font.hpp:31
static constexpr CharsetRange LatinExtendedB
Definition Font.hpp:32