feat: post-processing effects

This commit is contained in:
MihailRis
2025-04-05 00:41:25 +03:00
parent 22e97b1766
commit ba170035ef
19 changed files with 216 additions and 84 deletions
+24 -1
View File
@@ -16,7 +16,16 @@
class Assets;
enum class AssetType { TEXTURE, SHADER, FONT, ATLAS, LAYOUT, SOUND, MODEL };
enum class AssetType {
TEXTURE,
SHADER,
FONT,
ATLAS,
LAYOUT,
SOUND,
MODEL,
POST_EFFECT
};
namespace assetload {
/// @brief final work to do in the main thread
@@ -91,6 +100,20 @@ public:
return static_cast<T*>(found->second.get());
}
template <class T>
std::shared_ptr<T> getShared(const std::string& name) const {
const auto& mapIter = assets.find(typeid(T));
if (mapIter == assets.end()) {
return nullptr;
}
const auto& map = mapIter->second;
const auto& found = map.find(name);
if (found == map.end()) {
return nullptr;
}
return std::static_pointer_cast<T>(found->second);
}
template <class T>
T& require(const std::string& name) const {
T* asset = get<T>(name);