#include #include #include "texturestbi.h" #include "stb_image.h" TextureSTBI::TextureSTBI(const char* filename) { int w, h, ch; uint8_t* data = stbi_load(filename, &w, &h, &ch, 4); unsigned int format; if(ch == 4) { format = GL_RGBA; } else { format = GL_RGB; } build(data, format, w, h); stbi_image_free(data); }