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

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

#include "ParticleSystem.h"

class SandBox2D : public Hazel::Layer{
public:
    SandBox2D();
    virtual ~SandBox2D() = default;
    virtual void OnAttach() override;
    virtual void OnDetech() override;
    void OnUpdate(Hazel::TimeStep& ts) override;
    virtual void OnImGuiRender() override;
    void OnEvent(SDL_Event& e) override;

private:
    Hazel::OrthographicCameraController m_CameraController;
    Hazel::Ref<Hazel::VertexArray> m_SquareVA;
    Hazel::Ref<Hazel::Shader> m_FlatColorShader;
    Hazel::Ref<Hazel::Texture2D> m_Texture;
    Hazel::Ref<Hazel::Texture2D> m_LogoTexture;
    Hazel::Ref<Hazel::SubTexture2D> m_defaultTexture;
    Hazel::Ref<Hazel::FrameBuffer> m_FrameBuffer;

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

    struct ProfileResult
    {
        const char* Name;
        float Time;
    };

    std::vector<ProfileResult> m_ProfileResults;
    std::unordered_map<char, Hazel::Ref<Hazel::SubTexture2D>> m_TextureMap;
    uint32_t m_MapWidth, m_MapHeight;

    ParticleSystem m_ParticleSystem;
    ParticleProp m_Particle;

    SDL_WindowID m_CurrentWindowID;
};



#endif //SANDBOX2D_H
