MushMachine/framework/opengl_primitives/src/mm/opengl/texture_loader.hpp

30 lines
569 B
C++
Raw Normal View History

#pragma once
#include "./texture.hpp"
#include <utility>
// fwd
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;
};
struct TextureLoaderEmpty final {
template<typename... Args>
std::shared_ptr<Texture> load(Args&& ... args) const {
return Texture::createEmpty(std::forward<Args>(args)...);
}
};
} // MM::OpenGL