21 lines
398 B
C++
21 lines
398 B
C++
|
#include "texture.hpp"
|
||
|
|
||
|
namespace hibis {
|
||
|
Texture::Texture(char* path) : mData(), mImageWidth(0), mImageHeight(0), mBuffer() {
|
||
|
unsigned int error = lodepng::load_file(mBuffer, path);
|
||
|
if (error) {
|
||
|
TODO("error message")
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
error = lodepng::decode(mData, mImageWidth, mImageHeight, mBuffer);
|
||
|
|
||
|
if (error) {
|
||
|
TODO("error message")
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Texture::~Texture() {}
|
||
|
}
|