2020-11-10 14:26:38 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-12-11 13:24:42 +00:00
|
|
|
#include <filesystem>
|
2020-11-10 14:26:38 +00:00
|
|
|
#include <memory>
|
2021-02-01 18:03:45 +00:00
|
|
|
#include <string>
|
2021-09-26 19:18:25 +00:00
|
|
|
#include <list>
|
2020-11-10 14:26:38 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2022-02-01 17:09:40 +00:00
|
|
|
#include <hex/ui/view.hpp>
|
2020-11-10 14:26:38 +00:00
|
|
|
|
|
|
|
struct GLFWwindow;
|
2020-11-23 22:57:19 +00:00
|
|
|
struct ImGuiSettingsHandler;
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2021-08-18 20:36:46 +00:00
|
|
|
|
2020-11-10 14:26:38 +00:00
|
|
|
namespace hex {
|
|
|
|
|
2023-05-27 15:45:41 +00:00
|
|
|
void nativeErrorMessage(const std::string &message);
|
|
|
|
|
2020-11-10 14:26:38 +00:00
|
|
|
class Window {
|
|
|
|
public:
|
2022-02-15 22:07:48 +00:00
|
|
|
Window();
|
2020-11-10 14:26:38 +00:00
|
|
|
~Window();
|
|
|
|
|
|
|
|
void loop();
|
2023-09-07 18:33:49 +00:00
|
|
|
void fullFrame();
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2021-08-22 18:24:42 +00:00
|
|
|
static void initNative();
|
2021-08-17 20:54:09 +00:00
|
|
|
|
2023-10-04 10:00:32 +00:00
|
|
|
void resize(i32 width, i32 height);
|
|
|
|
|
2020-11-10 14:26:38 +00:00
|
|
|
private:
|
2021-08-18 20:36:46 +00:00
|
|
|
void setupNativeWindow();
|
2021-12-10 15:09:55 +00:00
|
|
|
void beginNativeWindowFrame();
|
|
|
|
void endNativeWindowFrame();
|
2023-12-31 10:39:06 +00:00
|
|
|
void drawTitleBar();
|
2023-05-25 07:26:40 +00:00
|
|
|
|
2020-11-10 14:26:38 +00:00
|
|
|
void frameBegin();
|
2021-06-07 16:14:40 +00:00
|
|
|
void frame();
|
2020-11-10 14:26:38 +00:00
|
|
|
void frameEnd();
|
|
|
|
|
|
|
|
void initGLFW();
|
|
|
|
void initImGui();
|
2022-01-17 23:10:10 +00:00
|
|
|
void exitGLFW();
|
|
|
|
void exitImGui();
|
2020-11-10 14:26:38 +00:00
|
|
|
|
2023-02-17 11:03:53 +00:00
|
|
|
void registerEventHandlers();
|
2021-08-22 18:24:42 +00:00
|
|
|
|
2022-01-24 19:53:17 +00:00
|
|
|
GLFWwindow *m_window = nullptr;
|
2020-11-23 22:57:19 +00:00
|
|
|
|
2023-12-14 12:50:26 +00:00
|
|
|
std::string m_windowTitle, m_windowTitleFull;
|
2021-08-18 20:36:46 +00:00
|
|
|
|
2023-12-11 10:42:33 +00:00
|
|
|
double m_lastStartFrameTime = 0;
|
2022-02-15 21:36:36 +00:00
|
|
|
double m_lastFrameTime = 0;
|
2021-03-06 12:09:20 +00:00
|
|
|
|
2023-11-16 21:24:06 +00:00
|
|
|
ImGuiExt::Texture m_logoTexture;
|
2021-08-18 20:36:46 +00:00
|
|
|
|
2022-09-19 14:09:22 +00:00
|
|
|
std::mutex m_popupMutex;
|
2021-09-26 19:18:25 +00:00
|
|
|
std::list<std::string> m_popupsToOpen;
|
2021-12-23 14:11:38 +00:00
|
|
|
std::vector<int> m_pressedKeys;
|
2022-02-21 20:55:04 +00:00
|
|
|
|
2023-12-27 12:54:00 +00:00
|
|
|
bool m_unlockFrameRate = false;
|
2023-08-25 21:54:39 +00:00
|
|
|
|
2023-11-16 21:24:06 +00:00
|
|
|
ImGuiExt::ImHexCustomData m_imguiCustomData;
|
2023-12-31 10:39:06 +00:00
|
|
|
|
|
|
|
u32 m_searchBarPosition;
|
2020-11-10 14:26:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|