Bug fixes in modelloading

This commit is contained in:
4VRDriver
2020-09-05 13:21:19 +02:00
parent dead2521c8
commit fff7c0bde2
12 changed files with 52 additions and 56 deletions

View File

@@ -9,7 +9,7 @@ Texture::Texture(const char* texturePath, uint8_t textureType) {
this->textureType = textureType;
stbi_set_flip_vertically_on_load(1);
stbi_uc *textureBuffer = stbi_load(texturePath, &textureWidth, &textureHeight, &bitsPerPixel, 4);
auto *textureBuffer = stbi_load(texturePath, &textureWidth, &textureHeight, &bitsPerPixel, 4);
// Push texture to grahics card;
glGenTextures(1, &textureId);
@@ -41,7 +41,7 @@ Texture::Texture(const char* texturePath, uint8_t textureType) {
}
Texture::~Texture() {
//glDeleteTextures(1, &textureId);
glDeleteTextures(1, &textureId);
}
void Texture::bind(uint8_t textureUnit, ShaderProgram* shaderProgram, uint8_t textureTypeNum) {