Initial texture atlas creation implementation

This commit is contained in:
Dan Paulat 2022-10-05 22:41:39 -05:00
parent 031e175fed
commit 17192470ec
3 changed files with 313 additions and 2 deletions

View file

@ -0,0 +1,41 @@
#pragma once
#include <scwx/qt/gl/gl.hpp>
#include <memory>
#include <string>
namespace scwx
{
namespace qt
{
namespace util
{
class TextureAtlas
{
public:
explicit TextureAtlas();
~TextureAtlas();
TextureAtlas(const TextureAtlas&) = delete;
TextureAtlas& operator=(const TextureAtlas&) = delete;
TextureAtlas(TextureAtlas&&) noexcept;
TextureAtlas& operator=(TextureAtlas&&) noexcept;
static TextureAtlas& Instance();
void RegisterTexture(const std::string& name, const std::string& path);
void BuildAtlas(size_t width, size_t height);
GLuint BufferAtlas(gl::OpenGLFunctions& gl);
private:
class Impl;
std::unique_ptr<Impl> p;
};
} // namespace util
} // namespace qt
} // namespace scwx