hibiscus/core/resources/texture.cpp

15 lines
343 B
C++
Raw Normal View History

2023-06-01 19:19:18 +00:00
#define STB_IMAGE_IMPLEMENTATION
#include <stb_image/stb_image.h>
2023-05-30 16:00:39 +00:00
#include "texture.hpp"
namespace hibis {
2023-06-01 19:19:18 +00:00
Texture::Texture(const char* path) : mData(), mImageWidth(0), mImageHeight(0), mImageChannels(0) {
mData = stbi_load(path, &mImageWidth, &mImageHeight, &mImageChannels, 0);
2023-05-30 16:00:39 +00:00
}
2023-06-01 19:19:18 +00:00
Texture::~Texture() {
stbi_image_free(mData);
}
2023-05-30 16:00:39 +00:00
}