15 lines
343 B
C++
15 lines
343 B
C++
#define STB_IMAGE_IMPLEMENTATION
|
|
#include <stb_image/stb_image.h>
|
|
|
|
#include "texture.hpp"
|
|
|
|
namespace hibis {
|
|
Texture::Texture(const char* path) : mData(), mImageWidth(0), mImageHeight(0), mImageChannels(0) {
|
|
mData = stbi_load(path, &mImageWidth, &mImageHeight, &mImageChannels, 0);
|
|
}
|
|
|
|
Texture::~Texture() {
|
|
stbi_image_free(mData);
|
|
}
|
|
}
|