FileTexture.cpp 368 B

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