40 glm::vec4 insert(T& data, dim width, dim height)
45 while (!allocateRect(r, width, height))
47 resize(data, side * 2);
49 this->onInsert(data, r.x, r.y);
50 return { float(r.x), float(r.y), float(r.x + r.width), float(r.y + r.height) };
53 virtual void onResize(T& data, dim side) = 0;
54 virtual void onInsert(T& data,
const dim& x,
const dim& y) = 0;
61 virtual ~TexturePacker() {
65 virtual glm::vec4 insert(T& data) = 0;
67 void resize(T& data, dim size)
70 this->onResize(data, size);
Definition TexturePacker.h:28