mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 19:50:05 +00:00
Initial texture atlas creation implementation
This commit is contained in:
parent
031e175fed
commit
17192470ec
3 changed files with 313 additions and 2 deletions
41
scwx-qt/source/scwx/qt/util/texture_atlas.hpp
Normal file
41
scwx-qt/source/scwx/qt/util/texture_atlas.hpp
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue