123456789101112131415 |
- #include "client/rendering/FileTexture.h"
- #include "client/utils/PNGReader.h"
- FileTexture::FileTexture(const char* path) {
- int maxWidth = 256;
- int maxHeight = 256;
- int buffer[256 * 256];
- if(PNGReader::load(path, buffer, maxWidth, maxHeight)) {
- texture.setColorData(maxWidth, maxHeight, reinterpret_cast<Color4*>(buffer));
- }
- }
- void FileTexture::bind(int index) const {
- texture.bind(index);
- }
|