From 1ad6bc34323f5b30d463ebe47a58d47ff9d4f328 Mon Sep 17 00:00:00 2001 From: hachem Date: Tue, 12 Aug 2025 19:17:50 +0200 Subject: [add]: Texture and Pixel buffers --- src/Rendering/Texture.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/Rendering/Texture.cpp (limited to 'src/Rendering/Texture.cpp') diff --git a/src/Rendering/Texture.cpp b/src/Rendering/Texture.cpp new file mode 100644 index 0000000..a52a469 --- /dev/null +++ b/src/Rendering/Texture.cpp @@ -0,0 +1,32 @@ +#include "Texture.h" +#include "Renderer.h" +#include "../Platform/OpenGL/OpenGLTexture.h" + +namespace Donut +{ + std::shared_ptr Texture2D::Create(uint32_t width, uint32_t height) + { + switch (Renderer::GetAPI()) + { + case RendererAPI::API::OpenGL: + return std::make_shared(width, height); + case RendererAPI::API::None: + return nullptr; + default: + return nullptr; + } + } + + std::shared_ptr Texture2D::Create(const std::string& path) + { + switch (Renderer::GetAPI()) + { + case RendererAPI::API::OpenGL: + return std::make_shared(path); + case RendererAPI::API::None: + return nullptr; + default: + return nullptr; + } + } +}; \ No newline at end of file -- cgit v1.3