2020-09-29 13:47:50 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "./texture.hpp"
|
2021-04-11 21:28:40 +02:00
|
|
|
|
2020-09-29 13:47:50 +02:00
|
|
|
#include <utility>
|
|
|
|
|
|
|
|
// fwd
|
2021-04-18 02:44:36 +02:00
|
|
|
typedef struct SDL_Surface SDL_Surface;
|
2020-09-29 13:47:50 +02:00
|
|
|
namespace MM {
|
|
|
|
class Engine;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MM::OpenGL {
|
|
|
|
|
|
|
|
struct TextureLoaderFile final {
|
|
|
|
std::shared_ptr<Texture> load(Engine& engine, const std::string& path) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TextureLoaderConstBuffer final {
|
|
|
|
std::shared_ptr<Texture> load(const uint8_t* data, size_t size) const;
|
|
|
|
};
|
|
|
|
|
2021-04-11 21:28:40 +02:00
|
|
|
struct TextureLoaderSDLSurface final {
|
|
|
|
std::shared_ptr<Texture> load(SDL_Surface* surface) const;
|
|
|
|
};
|
|
|
|
|
2020-09-29 13:47:50 +02:00
|
|
|
struct TextureLoaderEmpty final {
|
|
|
|
template<typename... Args>
|
|
|
|
std::shared_ptr<Texture> load(Args&& ... args) const {
|
|
|
|
return Texture::createEmpty(std::forward<Args>(args)...);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-02-17 16:27:49 +01:00
|
|
|
struct TextureLoaderEmptyMultiSampled final {
|
|
|
|
template<typename... Args>
|
|
|
|
std::shared_ptr<Texture> load(Args&& ... args) const {
|
|
|
|
return Texture::createEmptyMultiSampled(std::forward<Args>(args)...);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-09-29 13:47:50 +02:00
|
|
|
} // MM::OpenGL
|
|
|
|
|