mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
sys: Merge splash screen and ImHex into one application
This fixes so many issues the previous implementation had, especially on Unix
This commit is contained in:
41
include/init/splash_window.hpp
Normal file
41
include/init/splash_window.hpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <future>
|
||||
#include <vector>
|
||||
|
||||
#include <mutex>
|
||||
|
||||
struct GLFWwindow;
|
||||
|
||||
namespace hex::init {
|
||||
|
||||
class WindowSplash {
|
||||
public:
|
||||
WindowSplash(int &argc, char **&argv);
|
||||
~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 = 0;
|
||||
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;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user