aboutsummaryrefslogtreecommitdiff
path: root/src/Rendering/Texture.cpp
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
commite050dce79b67ae6386240567a994454711ab998d (patch)
tree4b5f55471d86b8ee80d531696e65dcea3b713e7a /src/Rendering/Texture.cpp
parent2e246683df3b18e8e129adb0ada25be5f82f5b59 (diff)
[add]: Custom memory managers and fix includes
Diffstat (limited to 'src/Rendering/Texture.cpp')
-rw-r--r--src/Rendering/Texture.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/Rendering/Texture.cpp b/src/Rendering/Texture.cpp
index 3a86dba..a96b816 100644
--- a/src/Rendering/Texture.cpp
+++ b/src/Rendering/Texture.cpp
@@ -1,18 +1,19 @@
#include "Texture.h"
#include "Renderer.h"
-#include "../Platform/OpenGL/OpenGLTexture.h"
-#include "../Platform/Vulkan/VulkanTexture.h"
+
+#include "Platform/OpenGL/OpenGLTexture.h"
+#include "Platform/Vulkan/VulkanTexture.h"
namespace Donut
{
- std::shared_ptr<Texture2D> Texture2D::Create(uint32_t width, uint32_t height)
+ Ref<Texture2D> Texture2D::Create(uint32_t width, uint32_t height)
{
switch (Renderer::GetAPI())
{
case RendererAPI::API::OpenGL:
- return std::make_shared<OpenGLTexture2D>(width, height);
+ return CreateRef<OpenGLTexture2D>(width, height);
case RendererAPI::API::Vulkan:
- return std::make_shared<VulkanTexture2D>(width, height);
+ return CreateRef<VulkanTexture2D>(width, height);
case RendererAPI::API::None:
return nullptr;
default:
@@ -20,14 +21,14 @@ namespace Donut
}
}
- std::shared_ptr<Texture2D> Texture2D::Create(const std::string& path)
+ Ref<Texture2D> Texture2D::Create(const std::string& path)
{
switch (Renderer::GetAPI())
{
case RendererAPI::API::OpenGL:
- return std::make_shared<OpenGLTexture2D>(path);
+ return CreateRef<OpenGLTexture2D>(path);
case RendererAPI::API::Vulkan:
- return std::make_shared<VulkanTexture2D>(path);
+ return CreateRef<VulkanTexture2D>(path);
case RendererAPI::API::None:
return nullptr;
default: