#pragma once

#include <Windows.h>
#include <string>

namespace UsdLayerManager {

class ImGuiContext {
public:
    ImGuiContext();
    ~ImGuiContext();
    
    bool Initialize(const std::string& windowTitle, int width, int height);
    void Shutdown();
    
    void NewFrame();
    void Render();
    
    bool ShouldClose() const { return m_shouldClose; }
    void SetShouldClose(bool value) { m_shouldClose = value; }
    
    HWND GetWindowHandle() const { return m_hwnd; }
    
    // Process Windows messages
    bool ProcessEvents();

private:
    bool CreateDeviceWGL();
    void CleanupDeviceWGL();
    
    static LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
    
    HWND m_hwnd;
    HDC m_hdc;
    HGLRC m_hglrc;
    bool m_shouldClose;
    int m_width;
    int m_height;
    std::string m_iniFilePath; // persists for the lifetime of the ImGui context
};

} // namespace UsdLayerManager
