summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gfx/models/texture.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/gfx/models/texture.cpp b/gfx/models/texture.cpp
index 90ec016..bc80a1c 100644
--- a/gfx/models/texture.cpp
+++ b/gfx/models/texture.cpp
@@ -8,7 +8,7 @@ Cache<Texture> Texture::cachedTexture;
Texture::Texture(const std::string & fileName) : m_texture {}
{
int width, height, numComponents;
- unsigned char * data = stbi_load((fileName).c_str(), &width, &height, &numComponents, 4);
+ unsigned char * data = stbi_load((fileName).c_str(), &width, &height, &numComponents, STBI_rgb_alpha);
if (!data) {
throw std::runtime_error {"Unable to load texture: " + fileName};
@@ -20,8 +20,8 @@ Texture::Texture(const std::string & fileName) : m_texture {}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
stbi_image_free(data);
}