1
0
mirror of synced 2024-12-04 20:17:57 +01:00
ImHex/main/gui/include/window.hpp
iTrooz 39252dfe48
refactor: Move custom ImGui functions to ImGuiExt namespace (#1427)
Co-authored-by: Nik <werwolv98@gmail.com>
2023-11-16 22:24:06 +01:00

76 lines
1.5 KiB
C++

#pragma once
#include <filesystem>
#include <memory>
#include <string>
#include <list>
#include <vector>
#include <hex/ui/view.hpp>
struct GLFWwindow;
struct ImGuiSettingsHandler;
namespace hex {
std::fs::path getImGuiSettingsPath();
void nativeErrorMessage(const std::string &message);
class Window {
public:
Window();
~Window();
void loop();
void fullFrame();
static void initNative();
void resize(i32 width, i32 height);
private:
void setupNativeWindow();
void beginNativeWindowFrame();
void endNativeWindowFrame();
void drawTitleBar();
void drawTitleBarBorderless() const;
void drawTitleBarBorder();
void frameBegin();
void frame();
void frameEnd();
void processEvent() { this->m_hadEvent = true; }
void initGLFW();
void initImGui();
void exitGLFW();
void exitImGui();
void registerEventHandlers();
GLFWwindow *m_window = nullptr;
std::string m_windowTitle;
double m_lastFrameTime = 0;
ImGuiExt::Texture m_logoTexture;
std::mutex m_popupMutex;
std::list<std::string> m_popupsToOpen;
std::vector<int> m_pressedKeys;
bool m_buttonDown = false;
bool m_hadEvent = false;
bool m_frameRateTemporarilyUnlocked = false;
double m_frameRateUnlockTime = 0;
ImGuiExt::ImHexCustomData m_imguiCustomData;
};
}