#pragma once
# include <imgui.h>
# include <string>
# include <memory>

namespace ImGui
{
    IMGUI_API inline void BeginHorizontal(const char* str_id, const ImVec2& size = ImVec2(0, 0), float align = -1.0f) { Begin(str_id); }
    IMGUI_API inline void BeginHorizontal(const void* id, const ImVec2& size = ImVec2(0, 0), float align = -1.0f)     { Begin("H"); }
    IMGUI_API inline void EndHorizontal()                                                                             { End(); }
    IMGUI_API inline void BeginVertical(const char* str_id, const ImVec2& size = ImVec2(0, 0), float align = -1.0f)   { Begin(str_id); }
    IMGUI_API inline void BeginVertical(const void* id, const ImVec2& size = ImVec2(0, 0), float align = -1.0f)       { Begin("V"); }
    IMGUI_API inline void EndVertical()                                                                               { End(); }
    IMGUI_API inline void Spring(float weight = 1.0f, float spacing = -1.0f)                                          { }//Spacing(); }
}

struct Application
{
    Application() {}
    Application(const char* name) {}
    Application(const char* name, int argc, char** argv) {}
    ~Application() {}
    bool Create(int width = -1, int height = -1) { return true; }
    int Run() { return 0; }
    void SetTitle(const char* title) {}
    void Quit() {}

    ImTextureID LoadTexture(const char* path) { return 0; }
    ImTextureID CreateTexture(const void* data, int width, int height) { return 0; }
    void        DestroyTexture(ImTextureID texture) {}
    int         GetTextureWidth(ImTextureID texture) { return 16; }
    int         GetTextureHeight(ImTextureID texture) { return 16; }

//    virtual void OnStart() {}
//    virtual void OnStop() {}
//    virtual void OnFrame(float deltaTime) {}
    virtual bool CanClose() { return true; }

private:
    std::string                 m_Name;
    std::string                 m_IniFilename;
    ImGuiContext*               m_Context = nullptr;
    ImFont*                     m_DefaultFont = nullptr;
    ImFont*                     m_HeaderFont = nullptr;
};

int Main(int argc, char** argv);
