mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
build: Cleaned up cmake build structure (#399)
* build: Cleanup build process, move main application to /main folder * build: Try fixing MacOS bundling * build: Fixed swapped parameters * build: One imhex -> main too much * build: Move resources to a better location * build: Try to fix macos bundle creation * build: More bundle fixes * build: Fixed syntax * build: Another try * build: Added macos debugging stuff * build: Fix bundle path * build: Removed duplicated adding of Frameworks folder to rpath * build: Removed debugging
This commit is contained in:
43
main/include/init/splash_window.hpp
Normal file
43
main/include/init/splash_window.hpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#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) {
|
||||
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;
|
||||
};
|
||||
|
||||
}
|
||||
22
main/include/init/tasks.hpp
Normal file
22
main/include/init/tasks.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace hex::init {
|
||||
|
||||
struct Task {
|
||||
std::string name;
|
||||
std::function<bool()> function;
|
||||
};
|
||||
|
||||
struct Argument {
|
||||
std::string name, value;
|
||||
};
|
||||
|
||||
std::vector<Task> getInitTasks();
|
||||
std::vector<Task> getExitTasks();
|
||||
|
||||
std::vector<Argument>& getInitArguments();
|
||||
}
|
||||
Reference in New Issue
Block a user