FileTexture.cpp 397 B

123456789101112131415
  1. #include "client/rendering/FileTexture.h"
  2. #include "client/utils/PNGReader.h"
  3. FileTexture::FileTexture(const char* path) {
  4. u32 maxWidth = 256;
  5. u32 maxHeight = 256;
  6. u32 buffer[256 * 256];
  7. if(PNGReader::load(path, buffer, maxWidth, maxHeight)) {
  8. texture.setRGBAData(maxWidth, maxHeight, buffer);
  9. }
  10. }
  11. void FileTexture::bind(uint index) const {
  12. texture.bind(index);
  13. }