From 0d819f2b9a71e862bce8799c6b0c1304e62219b3 Mon Sep 17 00:00:00 2001 From: hachem Date: Fri, 22 Aug 2025 12:24:05 +0200 Subject: [add]: add HDRI --- src/Rendering/Texture.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/Rendering/Texture.cpp') diff --git a/src/Rendering/Texture.cpp b/src/Rendering/Texture.cpp index a96b816..93b8a75 100644 --- a/src/Rendering/Texture.cpp +++ b/src/Rendering/Texture.cpp @@ -35,4 +35,34 @@ namespace Donut return nullptr; } } + + Ref CubemapTexture::Create(uint32_t width, uint32_t height) + { + switch (Renderer::GetAPI()) + { + case RendererAPI::API::OpenGL: + return CreateRef(width, height); + case RendererAPI::API::Vulkan: + return CreateRef(width, height); + case RendererAPI::API::None: + return nullptr; + default: + return nullptr; + } + } + + Ref CubemapTexture::CreateFromHDRI(const std::string& path) + { + switch (Renderer::GetAPI()) + { + case RendererAPI::API::OpenGL: + return CreateRef(path); + case RendererAPI::API::Vulkan: + return CreateRef(path); + case RendererAPI::API::None: + return nullptr; + default: + return nullptr; + } + } }; \ No newline at end of file -- cgit v1.3