hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/rendering/shader.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-08-14 00:42:05 +0200
committerhachem <im@hachem.wtf>2025-08-14 00:42:05 +0200
commit0d8b874c0048ca088bb9e353a5f7c62e1f8cd0e8 (patch)
tree2c0f3b13161489e4e91994882f8f2ed67a20bc0e /src/rendering/shader.h
parent9671d5e54484b8bce261207d08ff15053ae24e48 (diff)
feat: custom memory managers and fix includes
Diffstat (limited to 'src/rendering/shader.h')
-rw-r--r--src/rendering/shader.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/rendering/shader.h b/src/rendering/shader.h
index f490f3c..814f0cf 100644
--- a/src/rendering/shader.h
+++ b/src/rendering/shader.h
@@ -1,8 +1,9 @@
#pragma once
+#include "core/memory.h"
+
#include <string>
#include <unordered_map>
-#include <memory>
#include <glm/glm.hpp>
#define SHADER_STORAGE_BARRIER_BIT 0x00002000
@@ -42,15 +43,15 @@ namespace Donut
class ShaderLibrary
{
public:
- void add(const std::shared_ptr<Shader>& shader);
- void add(const std::string& name, const std::shared_ptr<Shader>& shader);
- std::shared_ptr<Shader> load(const std::string& filepath);
- std::shared_ptr<Shader> load(const std::string& name, const std::string& filepath);
+ void add(const Ref<Shader>& shader);
+ void add(const std::string& name, const Ref<Shader>& shader);
+ Ref<Shader> load(const std::string& filepath);
+ Ref<Shader> load(const std::string& name, const std::string& filepath);
- std::shared_ptr<Shader> get(const std::string& name);
+ Ref<Shader> get(const std::string& name);
bool exists(const std::string& name) const;
private:
- std::unordered_map<std::string, std::shared_ptr<Shader>> m_shaders;
+ std::unordered_map<std::string, Ref<Shader>> m_shaders;
};
};