5171bea0bf
This PR intends to add support for .NET scripts that can extend ImHex's functionality in a portable and cross-platform way. --------- Co-authored-by: Justus Garbe <55301990+Nowilltolife@users.noreply.github.com>
46 lines
904 B
C++
46 lines
904 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();
|
|
~WindowSplash();
|
|
|
|
bool loop();
|
|
|
|
void addStartupTask(const std::string &taskName, const TaskFunction &task, bool async) {
|
|
this->m_tasks.emplace_back(taskName, task, async);
|
|
}
|
|
|
|
private:
|
|
GLFWwindow *m_window;
|
|
std::mutex m_progressMutex;
|
|
std::atomic<float> m_progress = 0;
|
|
std::list<std::string> m_currTaskNames;
|
|
|
|
void initGLFW();
|
|
void initImGui();
|
|
|
|
void exitGLFW();
|
|
void exitImGui();
|
|
|
|
std::future<bool> processTasksAsync();
|
|
|
|
std::vector<std::tuple<std::string, TaskFunction, bool>> m_tasks;
|
|
|
|
std::string m_gpuVendor;
|
|
};
|
|
|
|
}
|