1
0
mirror of synced 2024-11-28 17:40:51 +01:00
ImHex/include/window.hpp
WerWolv 2362e7a11f sys: Enable logging colors on Windows, hide console
Console log can still be seen now when running ImHex through the console but the window won't pop up by default anymore
2021-08-22 20:24:42 +02:00

72 lines
1.6 KiB
C++

#pragma once
#include <filesystem>
#include <memory>
#include <string>
#include <vector>
#include <hex/helpers/utils.hpp>
#include <hex/views/view.hpp>
#include <imgui_imhex_extensions.h>
struct GLFWwindow;
struct ImGuiSettingsHandler;
namespace hex {
class Window {
public:
Window();
~Window();
void loop();
static void initNative();
private:
void setupNativeWindow();
void updateNativeWindow();
void drawTitleBar();
void frameBegin();
void frame();
void frameEnd();
void drawWelcomeScreen();
void resetLayout();
void initGLFW();
void initImGui();
void deinitGLFW();
void deinitImGui();
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);
void setFont(const std::filesystem::path &font_path);
GLFWwindow* m_window = nullptr;
float m_globalScale = 1.0F, m_fontScale = 1.0F;
double m_targetFps = 60.0;
bool m_demoWindowOpen = false;
bool m_layoutConfigured = false;
std::string m_windowTitle;
double m_lastFrameTime;
bool m_prevKeysDown[512];
std::string m_availableUpdate;
ImGui::Texture m_bannerTexture;
ImGui::Texture m_logoTexture;
std::filesystem::path m_safetyBackupPath;
};
}