//
// Created by sfd on 25-5-25.
//

#ifndef EDITORLAYER_H
#define EDITORLAYER_H
#include <Hazel.h>

#include "Panels/SceneHierachyPanel.h"

namespace Hazel
{
    class EditorLayer : public Layer
    {
    public:
        EditorLayer();
        virtual ~EditorLayer() = default;

        virtual void OnAttach() override;
        virtual void OnDetech() override;

        virtual void OnUpdate(TimeStep& ts) override;
        virtual void OnImGuiRender() override;
        virtual void OnEvent(SDL_Event& e) override;

    private:
        OrthographicCameraController m_CameraController;

        Ref<Texture2D> m_LogoTexture;
        Ref<Texture2D> m_CheckerBoardTexture;

        Ref<Scene> m_ActiveScene;
        Entity m_SquareEntity;
        Entity m_CameraEntity;
        Entity m_SecondCamera;

        bool m_PrimaryCamera = false;

        glm::vec4 m_BackgroundColor = { 0.2f, 0.2f, 0.2f, 1.0f };
        glm::vec4 m_SquareColor = { 0.2f, 0.2f, 0.2f, 1.0f };

        bool m_ViewportFocused = false, m_ViewportHovered = false;
        glm::vec2 m_ViewPortSize = {0, 0};

        Ref<FrameBuffer> m_FrameBuffer;

        SceneHierachyPanel m_SceneHierachyPanel;

    };
}


#endif //EDITORLAYER_H
