2026-02-03 13:33:31 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
2026-02-21 19:41:21 -08:00
|
|
|
#include <vulkan/vulkan.h>
|
2026-02-03 13:33:31 -08:00
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2026-02-25 03:45:13 -08:00
|
|
|
struct SDL_Window;
|
|
|
|
|
|
2026-02-03 13:33:31 -08:00
|
|
|
namespace wowee {
|
|
|
|
|
namespace rendering {
|
|
|
|
|
|
2026-02-21 19:41:21 -08:00
|
|
|
class VkContext;
|
|
|
|
|
|
2026-02-03 13:33:31 -08:00
|
|
|
class LoadingScreen {
|
|
|
|
|
public:
|
|
|
|
|
LoadingScreen();
|
|
|
|
|
~LoadingScreen();
|
|
|
|
|
|
|
|
|
|
bool initialize();
|
|
|
|
|
void shutdown();
|
|
|
|
|
|
|
|
|
|
void selectRandomImage();
|
|
|
|
|
|
2026-02-21 19:41:21 -08:00
|
|
|
// Render the loading screen with progress bar and status text (pure ImGui)
|
2026-02-03 13:33:31 -08:00
|
|
|
void render();
|
|
|
|
|
|
|
|
|
|
void setProgress(float progress) { loadProgress = progress; }
|
|
|
|
|
void setStatus(const std::string& status) { statusText = status; }
|
|
|
|
|
|
2026-02-21 19:41:21 -08:00
|
|
|
// Must be set before initialize() for Vulkan texture upload
|
|
|
|
|
void setVkContext(VkContext* ctx) { vkCtx = ctx; }
|
2026-02-25 03:45:13 -08:00
|
|
|
void setSDLWindow(SDL_Window* win) { sdlWindow = win; }
|
2026-02-21 19:41:21 -08:00
|
|
|
|
2026-02-03 13:33:31 -08:00
|
|
|
private:
|
|
|
|
|
bool loadImage(const std::string& path);
|
2026-02-21 19:41:21 -08:00
|
|
|
|
|
|
|
|
VkContext* vkCtx = nullptr;
|
2026-02-25 03:45:13 -08:00
|
|
|
SDL_Window* sdlWindow = nullptr;
|
2026-02-21 19:41:21 -08:00
|
|
|
|
|
|
|
|
// Vulkan texture for background image
|
|
|
|
|
VkImage bgImage = VK_NULL_HANDLE;
|
|
|
|
|
VkDeviceMemory bgMemory = VK_NULL_HANDLE;
|
|
|
|
|
VkImageView bgImageView = VK_NULL_HANDLE;
|
|
|
|
|
VkSampler bgSampler = VK_NULL_HANDLE;
|
|
|
|
|
VkDescriptorSet bgDescriptorSet = VK_NULL_HANDLE; // ImGui texture handle
|
2026-02-06 14:43:18 -08:00
|
|
|
|
2026-02-03 13:33:31 -08:00
|
|
|
std::vector<std::string> imagePaths;
|
|
|
|
|
int currentImageIndex = 0;
|
|
|
|
|
|
|
|
|
|
float loadProgress = 0.0f;
|
|
|
|
|
std::string statusText = "Loading...";
|
|
|
|
|
|
|
|
|
|
int imageWidth = 0;
|
|
|
|
|
int imageHeight = 0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace rendering
|
|
|
|
|
} // namespace wowee
|