#ifndef IMGUI_LAYER_HPP
#define IMGUI_LAYER_HPP

#include "open_engine/events/key_event.hpp"
#include "open_engine/events/event.hpp"
#include "open_engine/layer.hpp"

namespace OpenEngine {
    class ImGuiLayer : public Layer
    {
        public:
            ImGuiLayer();
            ~ImGuiLayer();

            virtual void OnAttach() override;
            virtual void OnDetach() override;
            virtual void OnImGuiRender() override;
            virtual void OnEvent(Event& event) override;
            bool CloseWindow(OpenEngine::KeyPressedEvent& event);

            void SetBlockEvents(bool block) { block_events = block; };

            void Begin();
            void End();

        private:
            bool block_events = false;
            float previous_frame_time = 0.0f;
    };
}

#endif // IMGUI_LAYER_HPP
