About to relearn this version of the language.

This commit is contained in:
2024-11-25 16:09:56 -06:00
parent f8c008fd45
commit cfa9e0e99a
23 changed files with 178 additions and 60 deletions

View File

@@ -4,7 +4,6 @@
// https://opensource.org/licenses/MIT
#include "AssetManager.hpp"
#include "loaders/TextureLoader.hpp"
using namespace Dawn;

View File

@@ -83,7 +83,16 @@ namespace Dawn {
* @return The asset loader for the given asset.
*/
template<class T>
std::shared_ptr<T> get(const std::string filename);
std::shared_ptr<T> get(const std::string filename) {
auto existing = this->getExisting<T>(filename);
if(existing) return existing;
std::shared_ptr<T> loader = std::make_shared<T>(filename);
pendingAssetLoaders.push_back(
std::static_pointer_cast<AssetLoader>(loader)
);
return loader;
}
/**
* Returns the asset loader for the given asset.

View File

@@ -12,4 +12,4 @@ target_sources(${DAWN_TARGET_NAME}
)
# Subdirs
add_subdirectory(loaders)
add_subdirectory(loader)