diff options
Diffstat (limited to 'src/Rendering/Shader.cpp')
| -rw-r--r-- | src/Rendering/Shader.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Rendering/Shader.cpp b/src/Rendering/Shader.cpp index e38ce65..8266e00 100644 --- a/src/Rendering/Shader.cpp +++ b/src/Rendering/Shader.cpp @@ -1,8 +1,8 @@ #include "Shader.h" #include "Renderer.h" + #include "Platform/OpenGL/OpenGLShader.h" #include "Platform/Vulkan/VulkanShader.h" -#include <memory> namespace Donut { @@ -45,32 +45,32 @@ namespace Donut } } - void ShaderLibrary::Add(const std::shared_ptr<Shader>& shader) + void ShaderLibrary::Add(const Ref<Shader>& shader) { auto& name = shader->GetName(); Add(name, shader); } - void ShaderLibrary::Add(const std::string& name, const std::shared_ptr<Shader>& shader) + void ShaderLibrary::Add(const std::string& name, const Ref<Shader>& shader) { m_Shaders[name] = shader; } - std::shared_ptr<Shader> ShaderLibrary::Load(const std::string& filepath) + Ref<Shader> ShaderLibrary::Load(const std::string& filepath) { - auto shader = std::shared_ptr<Shader>(Shader::Create(filepath)); + auto shader = Ref<Shader>(Shader::Create(filepath)); Add(shader); return shader; } - std::shared_ptr<Shader> ShaderLibrary::Load(const std::string& name, const std::string& filepath) + Ref<Shader> ShaderLibrary::Load(const std::string& name, const std::string& filepath) { - auto shader = std::shared_ptr<Shader>(Shader::Create(filepath)); + auto shader = Ref<Shader>(Shader::Create(filepath)); Add(name, shader); return shader; } - std::shared_ptr<Shader> ShaderLibrary::Get(const std::string& name) + Ref<Shader> ShaderLibrary::Get(const std::string& name) { if (Exists(name)) return m_Shaders[name]; |
