#ifndef CUBEMAP_HPP_
#define CUBEMAP_HPP_

#include <Vk/ShaderModule/ShaderModule.hpp>
#include <string>
#include <atomic>
#include <memory>

#include <Vk/Image/Image.hpp>
#include <Vk/ImageView/ImageView.hpp>

/**
 * @brief Represents a cube map (such as a skybox).
 */
class Cubemap
{
private:
    std::string m_name;
    std::shared_ptr<Vk::Image> m_image;
    std::shared_ptr<Vk::ImageView> m_imageView;

public:
    Cubemap(const std::string &name);

    /**
     * @brief Perform the loading of this cubemap.
     */
    void load(std::atomic<unsigned int> &tasksDone);

    /**
     * @brief Generate this cubemap from a compute shader.
     */
    void generate(glm::uvec2 size, Vk::ShaderModule &shader, std::atomic<unsigned int> &tasksDone);

    /**
     * @brief Returns a reference to the image view for this cubemap.
     */
    Vk::ImageView& imageView();

    #define DECL_CUBEMAP(name) static Cubemap name
    #include <Cubemap/CubemapList.hpp>
};

#endif