3#include "backends/opengl/IB.h"
4#include "backends/opengl/VA.h"
5#include "backends/opengl/VB.h"
6#include "material/Material.h"
13 Mesh(
const std::vector<Vertex> &vertices,
const std::vector<
unsigned int> &indices);
15 Mesh(
const std::vector<Vertex> &vertices,
16 const std::vector<
unsigned int> &indices,
26 bool is_built()
const {
return vao_ !=
nullptr; }
std::shared_ptr< Texture > get_texture(AssetID id)
size_t get_loaded_mesh_count() const
std::unordered_map< AssetID, std::shared_ptr< Texture > > texture_cache_
AssetManager(AssetRegistry ®istry)
std::shared_ptr< Mesh > get_mesh(AssetID id)
size_t get_loaded_material_count() const
AssetRegistry & registry_
std::unordered_map< AssetID, std::shared_ptr< Material > > material_cache_
size_t get_loaded_texture_count() const
std::shared_ptr< Material > get_material(AssetID id)
std::unordered_map< AssetID, std::shared_ptr< Mesh > > mesh_cache_
Registry for storing assets.
const std::filesystem::path & get_project_root()
std::optional< AssetID > get_uuid_by_path(const std::filesystem::path &filepath)
AssetID generate_uuid(const std::filesystem::path &filepath)
void unregister_asset(AssetID uuid)
bool has_asset_changed(AssetID uuid) const
void set_project_root(const std::filesystem::path &project_root)
std::filesystem::path get_absolute_path(AssetID uuid)
std::unordered_map< std::filesystem::path, AssetID > path_to_uuid_
std::filesystem::path registry_file_
AssetID register_asset(const std::filesystem::path &filepath, AssetType type)
std::unordered_map< AssetID, AssetMetadata > assets_
std::filesystem::path to_absolute_path(const std::filesystem::path &relative_path) const
static AssetType get_type_from_extension(const std::filesystem::path &filepath)
std::filesystem::path to_relative_path(const std::filesystem::path &absolute_path) const
AssetID register_asset(const std::filesystem::path &filepath)
std::vector< AssetID > register_directory(const std::filesystem::path &directory_path, bool recursive)
std::vector< AssetMetadata > get_assets_by_type(AssetType type)
std::filesystem::path get_relative_path(AssetID uuid)
bool asset_exists(AssetID uuid) const
size_t get_asset_count() const
std::vector< AssetID > get_modified_assets() const
AssetRegistry(const std::filesystem::path ®istry_file, const std::filesystem::path &project_root)
std::optional< AssetMetadata > get_asset(AssetID uuid) const
std::filesystem::path project_root_
std::vector< AssetMetadata > get_all_assets() const
uint64_t get_file_last_modified(const std::filesystem::path &filepath) const
static std::optional< MaterialData > load(const std::filesystem::path &filepath)
static std::shared_ptr< Mesh > load(const std::filesystem::path &filepath)
Mesh(const std::vector< Vertex > &vertices, const std::vector< unsigned int > &indices)
int get_index_count() const
std::unique_ptr< VA > vao_
std::unique_ptr< IB > ibo_
std::vector< Vertex > vertices
Mesh(const std::vector< Vertex > &vertices, const std::vector< unsigned int > &indices, bool defer_build)
std::unique_ptr< VB > vbo_
std::vector< unsigned int > indices
void draw_instanced(size_t amount) const
constexpr AssetID INVALID_ASSET_ID