#ifndef IMGUI_CAPPLICATION_H #define IMGUI_CAPPLICATION_H #include "imgui.h" #include "imgui_impl_opengl3.h" #include "imgui_internal.h" #include "iostream" #include "OSCA.h" #include // For PATH_MAX #include // For getcwd static void glfw_error_callback(int error, const char* description){ fprintf(stderr, "GLFW Error %d: %s\n", error, description); } namespace CTL { class GUI_Application{ public: virtual ~GUI_Application() = default; #ifdef _WIN32 GLFWwindow* window{}; GLFWvidmode* mode{}; #elif __linux__ GLFWwindow* window{}; GLFWvidmode* mode{}; Window x11Window{}; Display* display{}; int screen = 0; #endif HSize Size = {1024,800}; HSize ReSize = {0,0}; HPos Pos = {0,50}; std::string Title = "ImGui"; bool WindowCreateFlag = false,NoFrameFlag = false,CenterFlag = false; ImVec4 Background = RGBA(255,255,255,255); ImVec4 ClearGround = RGBA(0,0,0,0); int argc = 0; std::string* argv = nullptr; float opacity = 0.0f; GUI_Application(); GUI_Application(GUI_Application&& other) noexcept ; GUI_Application(int argc,char** argv) noexcept ; explicit GUI_Application(GUI_Application* CApp); //---------------------------------------------------------------- bool WindowCreate(); void InitGL() const; virtual void StyleWindow(){}; bool NewFrame() const; void Render() const; int SwapBuffers() const; static int Stop(); //---------------------------------------------------------------- static std::string GetTheProgramDirectory(); static void Close(); //---------------------------------------------------------------- private: std::string glsl_version; bool closea = false; }; } #endif