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>
|
2020-11-10 14:26:38 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2021-01-13 16:28:27 +00:00
|
|
|
#include <hex/views/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 {
|
|
|
|
|
|
|
|
class Window {
|
|
|
|
public:
|
2021-04-20 19:46:48 +00:00
|
|
|
Window();
|
2020-11-10 14:26:38 +00:00
|
|
|
~Window();
|
|
|
|
|
|
|
|
void loop();
|
|
|
|
|
2021-08-22 18:24:42 +00:00
|
|
|
static void initNative();
|
2021-08-17 20:54:09 +00:00
|
|
|
|
2020-11-10 14:26:38 +00:00
|
|
|
private:
|
2021-08-18 20:36:46 +00:00
|
|
|
void setupNativeWindow();
|
|
|
|
void updateNativeWindow();
|
|
|
|
void drawTitleBar();
|
|
|
|
|
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();
|
|
|
|
|
2021-01-27 00:10:13 +00:00
|
|
|
void drawWelcomeScreen();
|
2021-02-21 12:49:03 +00:00
|
|
|
void resetLayout();
|
2021-01-27 00:10:13 +00:00
|
|
|
|
2020-11-10 14:26:38 +00:00
|
|
|
void initGLFW();
|
|
|
|
void initImGui();
|
|
|
|
void deinitGLFW();
|
|
|
|
void deinitImGui();
|
|
|
|
|
2021-08-22 18:24:42 +00:00
|
|
|
friend void *ImHexSettingsHandler_ReadOpenFn(ImGuiContext *ctx, ImGuiSettingsHandler *, const char *);
|
|
|
|
friend void ImHexSettingsHandler_ReadLine(ImGuiContext*, ImGuiSettingsHandler *handler, void *, const char* line);
|
|
|
|
friend void ImHexSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandler *handler, ImGuiTextBuffer *buf);
|
|
|
|
|
2021-01-27 13:26:24 +00:00
|
|
|
GLFWwindow* m_window = nullptr;
|
2020-11-23 22:57:19 +00:00
|
|
|
|
2021-04-21 21:31:51 +00:00
|
|
|
double m_targetFps = 60.0;
|
2020-11-23 21:23:06 +00:00
|
|
|
bool m_demoWindowOpen = false;
|
2021-02-21 12:49:03 +00:00
|
|
|
bool m_layoutConfigured = false;
|
2020-11-11 13:41:44 +00:00
|
|
|
|
2021-08-18 20:36:46 +00:00
|
|
|
std::string m_windowTitle;
|
|
|
|
|
2021-03-06 12:09:20 +00:00
|
|
|
double m_lastFrameTime;
|
|
|
|
|
2021-04-16 17:43:54 +00:00
|
|
|
bool m_prevKeysDown[512];
|
|
|
|
|
2021-04-18 18:24:42 +00:00
|
|
|
std::string m_availableUpdate;
|
2021-07-28 22:39:58 +00:00
|
|
|
|
2021-08-22 19:11:01 +00:00
|
|
|
bool m_showTipOfTheDay;
|
|
|
|
std::string m_tipOfTheDay;
|
|
|
|
|
2021-08-18 20:36:46 +00:00
|
|
|
ImGui::Texture m_bannerTexture;
|
|
|
|
ImGui::Texture m_logoTexture;
|
|
|
|
|
2021-08-17 20:54:09 +00:00
|
|
|
std::filesystem::path m_safetyBackupPath;
|
2020-11-10 14:26:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|