1
0
mirror of synced 2024-11-19 05:17:12 +01:00
ImHex/splash/include/splash_window.hpp
WerWolv ebbbcafe5c
sys: Implement more functionality into splash screen (#223)
* build: Add libcurl

* build: Stop the whole static linking on Windows mess. There's no use anymore

* sys: Added update detector and moved some startup tasks to splash screen

* sys: Updated ImHex icon

* fix: Settings button on welcome page once again works

* build: Fix build on Linux

* sys: Fixed splash window not searching all paths for resources
2021-04-18 20:24:42 +02:00

41 lines
784 B
C++

#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;
};
}