2025-03-13 12:00:14 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <GLFW/glfw3.h>
|
2025-03-14 19:32:40 +01:00
|
|
|
|
2025-03-13 12:00:14 +01:00
|
|
|
#include <cstdio>
|
|
|
|
|
|
2025-03-14 19:32:40 +01:00
|
|
|
#include "Image.hpp"
|
2025-03-13 12:00:14 +01:00
|
|
|
#include "imgui.h"
|
|
|
|
|
#include "imgui_impl_glfw.h"
|
|
|
|
|
#include "imgui_impl_opengl3.h"
|
|
|
|
|
|
2025-03-14 19:32:40 +01:00
|
|
|
namespace pixelarium::ui
|
2025-03-13 12:00:14 +01:00
|
|
|
{
|
|
|
|
|
enum LogLevelSelection
|
|
|
|
|
{
|
|
|
|
|
Debug = 0,
|
|
|
|
|
Info = 1,
|
|
|
|
|
Warning = 2,
|
|
|
|
|
Error = 3
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class AppGLFW
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
AppGLFW();
|
|
|
|
|
int Run();
|
|
|
|
|
|
2025-03-14 19:32:40 +01:00
|
|
|
private:
|
|
|
|
|
void MenuBar();
|
|
|
|
|
void LoadImageProt();
|
|
|
|
|
|
2025-03-13 12:00:14 +01:00
|
|
|
private:
|
|
|
|
|
LogLevelSelection log_level_ = static_cast<LogLevelSelection>(0);
|
|
|
|
|
GLFWwindow* window = nullptr;
|
|
|
|
|
ImGuiWindowFlags window_flags = 0;
|
2025-03-14 19:32:40 +01:00
|
|
|
pixelarium::imaging::Image _img;
|
|
|
|
|
bool _imagep { false };
|
2025-03-13 12:00:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static void glfw_error_callback(int error, const char* description)
|
|
|
|
|
{
|
|
|
|
|
fprintf(stderr, "GLFW Error %d: %s\n", error, description);
|
|
|
|
|
}
|
|
|
|
|
} // namespace ui
|