//
// Created by spenc on 5/18/2025.
//

#ifndef EDITOR_H
#define EDITOR_H
#define OX_EDITOR_VERSION "Obsidian Editor (0.2.6)"
#include "Layer.h"
#include "Core.h"
#include "types/all.h"

#undef IM_ASSERT
#define IM_ASSERT(_EXPR) do { OX_ASSERT(_EXPR, "ImGui internal assertion failed"); } while (0)

#include <imgui.h>
#include <imgui_impl_opengl3.h>
#include <imgui_impl_glfw.h>


namespace OX
{
    class Viewport;
    class FileBrowser;
    class InspectorWindow;
    class SceneExplorer;

    class Editor final : public Layer
    {
    public:
        using Layer::Layer;

        void Init(Core &core) override;

        void Update(Core &core) override;

        void Draw(Core &core) override;

        void Shutdown(Core &core) override;


        //? Getters

        GameObject *GetSelected() { return selected; }
        void SetSelected(GameObject *obj) { selected = obj; }

    private:
        std::shared_ptr<Viewport> primaryViewport;
        std::shared_ptr<FileBrowser> fileBrowser;
        std::shared_ptr<InspectorWindow> inspectorWindow;
        std::shared_ptr<SceneExplorer> sceneExplorer;

        GameObject *selected;
    };
} // OX

#endif //EDITOR_H
