1
0
mirror of synced 2024-11-25 00:00:27 +01:00
ImHex/include/init/splash_window.hpp
WerWolv e74c0f5cf5 sys: Tons of long overdue cleanup
- std::string -> const std::string& where needed
- Added a FileIO abstraction class
- Fixed recent files not updating
- Removed localization file from global include
- Renamed lang to pattern_language/pl
- Renamed EventFileDropped to RequestFileOpen
2021-09-08 15:18:24 +02:00

43 lines
845 B
C++

#pragma once
#include <functional>
#include <future>
#include <vector>
#include <mutex>
struct GLFWwindow;
namespace hex::init {
using TaskFunction = std::function<bool()>;
class WindowSplash {
public:
WindowSplash(int &argc, char **&argv);
~WindowSplash();
bool loop();
void addStartupTask(const std::string &taskName, const TaskFunction &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, TaskFunction>> m_tasks;
};
}