//
// Created by sebastian on 04.08.26.
//

#ifndef COLORRACE_DEBUGLAYER_H
#define COLORRACE_DEBUGLAYER_H
#include "Layer.h"
#include "renderer/DebugRenderer.h"
#include "renderer/RenderQueue.h"

namespace engine {
    class Model;

    class DebugLayer: public Layer {
    public:
        DebugLayer(engine::EventBus<animation::AnimationMarkerEvent>& animationEventbus, Camera& camera, engine::EntityRegistry& registry, Keyboard &keyboard, Mouse &mouse, std::shared_ptr<Model> sphereModel)
            : Layer(keyboard, mouse, animationEventbus), m_entityRegistry(registry), m_sphereModel(std::move(sphereModel)), m_camera(camera) {
        }

        void onUpdate(float deltaTime) override;
        void onRender() override;
    protected:

        void onAttachImpl() override;
        void onDetachImpl() override;

    private:
        engine::EntityRegistry& m_entityRegistry;
        bool m_showDebugInfo = true;

        std::shared_ptr<engine::Model> m_sphereModel;
        RenderQueue m_renderQueue;
        DebugRenderer m_debugRenderer;

        Camera& m_camera;
    };


}
#endif //COLORRACE_DEBUGLAYER_H
