#pragma once

#include <vector>
#include <queue>

#include "Core/Core.h"
#include "Core/Singleton.h"

class ImageBuffer : public Singleton<ImageBuffer> {
public:
    enum class IBType {
        Background,

    };
public:
    explicit ImageBuffer() noexcept = default;
    ~ImageBuffer() = default;

    ImageBuffer(const ImageBuffer&) = delete;
    ImageBuffer& operator=(const ImageBuffer&) = delete;

    bool Initialize() override;
    void Uninitialize() override;

    void PushImage(IBType type, std::vector<uint8> data, uint32 width, uint32 height, uint32 comp);
    void Update(IBType type, class Texture2D* texture);

private:
    void PushBackgroundImage(std::vector<uint8> data, uint32 width, uint32 height, uint32 comp);
    void UpdateBackground(class Texture2D* texture);
private:
    struct Image {
        std::vector<uint8> data;
        uint32 width;
        uint32 height;
        uint32 comp;
    };
    CriticalSection cs_;
    Image background_;
    

};
