#pragma once #include #include #include #include #include #include struct GLFWwindow; struct ImGuiSettingsHandler; namespace hex { class Window { public: Window(); ~Window(); void loop(); static void initNative(); private: void setupNativeWindow(); void beginNativeWindowFrame(); void endNativeWindowFrame(); void drawTitleBar(); void frameBegin(); void frame(); void frameEnd(); void processEvent() { this->m_hadEvent = true; } void initGLFW(); void initImGui(); void exitGLFW(); void exitImGui(); 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); GLFWwindow *m_window = nullptr; std::string m_windowTitle; double m_lastFrameTime = 0; ImGui::Texture m_logoTexture; std::mutex m_popupMutex; std::list m_popupsToOpen; std::vector m_pressedKeys; std::fs::path m_imguiSettingsPath; bool m_mouseButtonDown = false; bool m_hadEvent = false; bool m_frameRateTemporarilyUnlocked = false; double m_frameRateUnlockTime = 0; }; }