12345678910111213141516171819 |
- #include <cmath>
- #include <iostream>
- #include "client/rendering/NormalTexture.h"
- #include "client/utils/PNGReader.h"
- NormalTexture::NormalTexture(const char* path) : texture(Texture::LINEAR) {
- u32 maxWidth = 512;
- u32 maxHeight = 512;
- u32* buffer = new u32[maxWidth * maxHeight];
- if(PNGReader::load(path, buffer, maxWidth, maxHeight)) {
- texture.setRGBAData(maxWidth, maxHeight, buffer);
- }
- delete[] buffer;
- }
- void NormalTexture::bind(uint index) const {
- texture.bind(index);
- }
|