aboutsummaryrefslogtreecommitdiff
path: root/src/Core/HDRIManager.cpp
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-20 02:27:02 +0200
committerhachem <im@hachem.wtf>2026-08-20 02:40:07 +0200
commit5b361d81dbd2af0d0e99b9eb1adebea76ff05db0 (patch)
tree34db1df17e8c7248aeeb92156d635d31c2484e3f /src/Core/HDRIManager.cpp
parente3abaaf59777258ba06705135a0cafcb5918ad12 (diff)
[chore]: MASSIVE refactor + more vulkan bs
Diffstat (limited to 'src/Core/HDRIManager.cpp')
-rw-r--r--src/Core/HDRIManager.cpp64
1 files changed, 0 insertions, 64 deletions
diff --git a/src/Core/HDRIManager.cpp b/src/Core/HDRIManager.cpp
deleted file mode 100644
index 6e420a6..0000000
--- a/src/Core/HDRIManager.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-#include "HDRIManager.h"
-#include <filesystem>
-
-namespace Donut
-{
- Ref<CubemapTexture> HDRIManager::LoadHDRI(const std::string& path)
- {
- auto it = m_HDRICache.find(path);
- if (it != m_HDRICache.end())
- {
- DONUT_INFO("HDRI already cached: {}", path);
- return it->second;
- }
-
- DONUT_INFO("Loading HDRI: {}", path);
- auto hdri = CubemapTexture::CreateFromHDRI(path);
-
- if (hdri)
- {
- m_HDRICache[path] = hdri;
- DONUT_INFO("Successfully loaded and cached HDRI: {}", path);
- }
- else
- DONUT_ERROR("Failed to load HDRI: {}", path);
-
- return hdri;
- }
-
- void HDRIManager::SetCurrentHDRI(const std::string& path)
- {
- auto hdri = LoadHDRI(path);
- if (hdri)
- {
- m_CurrentHDRI = hdri;
- DONUT_INFO("Set current HDRI to: {}", path);
- }
- else
- DONUT_ERROR("Failed to set current HDRI: {}", path);
- }
-
- std::string HDRIManager::GetHDRIName(const std::string& path) const
- {
- std::filesystem::path filePath(path);
- std::string filename = filePath.stem().string();
- std::string name = filename;
-
- for (size_t i = 0; i < name.length(); ++i)
- {
- if (name[i] == '_')
- name[i] = ' ';
- else if (i == 0 || name[i-1] == ' ')
- name[i] = std::toupper(name[i]);
- }
-
- return name;
- }
-
- void HDRIManager::ClearCache()
- {
- m_HDRICache.clear();
- m_CurrentHDRI.reset();
- DONUT_INFO("HDRI cache cleared");
- }
-};