mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 17:40:05 +00:00
Expose texture attributes in interface
This commit is contained in:
parent
71d873f4b4
commit
e4629eb9ef
2 changed files with 80 additions and 16 deletions
|
|
@ -5,6 +5,8 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <boost/gil/point.hpp>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace qt
|
||||
|
|
@ -12,6 +14,44 @@ namespace qt
|
|||
namespace util
|
||||
{
|
||||
|
||||
struct TextureAttributes
|
||||
{
|
||||
TextureAttributes() :
|
||||
valid_ {false},
|
||||
position_ {},
|
||||
size_ {},
|
||||
sLeft_ {},
|
||||
sRight_ {},
|
||||
tTop_ {},
|
||||
tBottom_ {}
|
||||
{
|
||||
}
|
||||
|
||||
TextureAttributes(boost::gil::point_t position,
|
||||
boost::gil::point_t size,
|
||||
float sLeft,
|
||||
float sRight,
|
||||
float tTop,
|
||||
float tBottom) :
|
||||
valid_ {true},
|
||||
position_ {position},
|
||||
size_ {size},
|
||||
sLeft_ {sLeft},
|
||||
sRight_ {sRight},
|
||||
tTop_ {tTop},
|
||||
tBottom_ {tBottom}
|
||||
{
|
||||
}
|
||||
|
||||
bool valid_;
|
||||
boost::gil::point_t position_;
|
||||
boost::gil::point_t size_;
|
||||
float sLeft_;
|
||||
float sRight_;
|
||||
float tTop_;
|
||||
float tBottom_;
|
||||
};
|
||||
|
||||
class TextureAtlas
|
||||
{
|
||||
public:
|
||||
|
|
@ -30,6 +70,8 @@ public:
|
|||
void BuildAtlas(size_t width, size_t height);
|
||||
GLuint BufferAtlas(gl::OpenGLFunctions& gl);
|
||||
|
||||
TextureAttributes GetTextureAttributes(const std::string& name);
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue