#pragma once

#include "../../api/Images.hpp"
#include <GL/gl3w.h>

namespace render::gl {

class Image: public render::Image {
public:
    virtual ~Image();

    constexpr GLuint getId() const { return id; }

protected:
    Image(GLuint id): id(id) { }
    GLuint id;
};

class Texture: public render::Texture, public Image {
public:
    static std::unique_ptr<Texture> LoadFromFile(const std::string&, const sampling&);

protected:
    Texture(GLuint id): gl::Image(id) { }
};

class TextureCube: public render::TextureCube, public Texture {
public:
    /// Looks for .right.dds, .left.dds, .top.dds, .bottom.dds, .front.dds, .back.dds
    static std::unique_ptr<TextureCube> LoadFromFiles(const std::string& prefix, const sampling&);
    static std::unique_ptr<TextureCube> LoadFromFiles(const std::array<std::string, 6>& paths, const sampling&);

protected:
    TextureCube(GLuint id): Texture(id) { }
};

class TextureArray: public render::TextureArray, public Texture {
public:
    static std::unique_ptr<TextureArray> LoadFromFiles(const std::vector<std::string>&, const sampling&);

protected:
    TextureArray(uint32_t size, GLuint id): render::TextureArray(size), Texture(id) { }
};

}