add NodeImageTexture for dynamic images, test image thumbnail opening and rendering

This commit is contained in:
2017-05-01 22:22:16 +01:00
parent 3ea3fadc46
commit 16a53af679
7 changed files with 166 additions and 16 deletions

View File

@@ -6,12 +6,20 @@ class Image
{
std::unique_ptr<uint8_t[]> m_data;
public:
int width;
int height;
int comp;
int width = 0;
int height = 0;
int comp = 4;
bool load(std::string filename);
const uint8_t* data() const { return m_data.get(); }
int size() const { return width * height * comp; }
void create(int w, int h)
{
width = w;
height = h;
comp = 4;
m_data = std::make_unique<uint8_t[]>(size());
}
void create() { m_data = std::make_unique<uint8_t[]>(size()); }
};
}