1
0
mirror of synced 2024-11-19 05:17:12 +01:00
ImHex/splash/include/splash_window.hpp

41 lines
784 B
C++
Raw Normal View History

#pragma once
#include <functional>
#include <future>
#include <vector>
#include <mutex>
struct GLFWwindow;
namespace hex::pre {
class WindowSplash {
public:
WindowSplash();
~WindowSplash();
bool loop();
void addStartupTask(std::string_view taskName, const std::function<bool()> &task) {
this->m_tasks.emplace_back(taskName, task);
}
private:
GLFWwindow *m_window;
std::mutex m_progressMutex;
float m_progress;
std::string m_currTaskName;
void initGLFW();
void initImGui();
void deinitGLFW();
void deinitImGui();
std::future<bool> processTasksAsync();
std::vector<std::pair<std::string, std::function<bool()>>> m_tasks;
};
}