#ifndef FILE_TEXTURE_H #define FILE_TEXTURE_H #include "rendering/wrapper/Texture.h" #include "gaming-core/images/PNGReader.h" class FileTexture final { Texture texture; public: FileTexture(const char* path); void bind() const; private: template void read(PNGReader& png) { Color* buffer = new Color[png.getBufferSize()]; if(png.readData(buffer)) { return; } texture.setColorData(png.getWidth(), png.getHeight(), buffer); delete[] buffer; } }; #endif