3#include <unordered_map>
7#include "math/vector_2.h"
8#include "math/vector_3.h"
11#include "sound/soundbuffer.h"
52 const std::string& file_path,
53 const std::string& identifier);
66 const Mesh&
getMesh(
const std::string&
id)
const;
93 const SoundBuffer&
getSound(
const std::string&
id)
const;
98 bool addMesh(
const std::string&
id,
const std::vector<coma::Vec3>& pos,
99 const std::vector<coma::Vec3>& normal,
100 const std::vector<coma::Vec3>& color,
101 const std::vector<coma::Vec2>& uv,
102 const std::vector<unsigned int>& indices);
104 bool addTexture(
const std::string&
id,
const unsigned int tex_id,
105 const Format internal_format,
106 const ColorFormat color_format,
const Filter min_filter,
107 const Filter mag_filter,
const Wrap wrap_s,
const Wrap wrap_t,
108 const Wrap wrap_r,
const DataType data_type);
110 bool addSound(
const std::string&
id,
int buffid, SoundData sound_info_);
114 JobSystem* job_system_;
115 std::vector<std::future<std::optional<Obj>>> loading_meshes_;
116 std::vector<std::future<std::optional<Texture>>> loading_textures_;
117 std::vector<std::future<std::optional<SoundBuffer>>> loading_sounds_;
118 std::unordered_map<std::string, Mesh> meshes_;
119 std::unordered_map<std::string, Texture> textures_;
120 std::unordered_map<std::string, SoundBuffer> soundbuffers_;
Intiliazes the ComponentManager and the ResourceManager and ofers functions to retrieve them.
Definition: engine.hpp:12
Stores and offers access to all meshes, textures, and sounds of the engine.
Definition: resource_manager.hpp:27
ResourceManager & operator=(ResourceManager &&other)=delete
Move assignment operator (deleted).
ResourceManager & operator=(ResourceManager &other)=delete
Copy assignment operator (deleted).
const SoundBuffer & getSound(const std::string &id) const
Retrieve a SoundBuffer.
void loadResource(const ResourceType &resource_type, const std::string &file_path, const std::string &identifier)
Load an external asset from a file using multithreading.
bool WaitResourceLoad()
Stops the program, waiting for resource loading to complete.
ResourceManager(ResourceManager &&other)=delete
Move constructor (deleted).
const Texture & getEmptyTexture() const
Retrieve a white texture.
const Mesh & getMesh(const BasicMesh id) const
Retrieve a mesh.
ResourceManager(const ResourceManager &other)=delete
Copy constructor (deleted).
const Texture & getTexture(const std::string &id) const
Retrieve a texture.
const Mesh & getMesh(const std::string &id) const
Retrieve a mesh.
contains globally accessible enums
BasicMesh
meshed loaded by default by the engine
Definition: globals.hpp:141
ResourceType
Types of resources to load.
Definition: resource_manager.hpp:20
@ kSound
Sound accepts .wav.
@ kTexture
Texture accepts .png and .jpg.
@ kMesh
Mesh accepts .obj.