Update textures.cpp

On line 109 glGenerateMipmap is getting called but the GL_TEXTURE_MIN_FILTER uses GL_LINEAR. Changed it to GL_LINEAR_MIPMAP_LINEAR
This commit is contained in:
Jelle Vos
2021-08-28 19:04:33 +02:00
committed by GitHub
parent 48010de993
commit c85067d4fe

View File

@@ -97,7 +97,7 @@ int main()
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); // set texture wrapping to GL_REPEAT (default wrapping method) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); // set texture wrapping to GL_REPEAT (default wrapping method)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
// set texture filtering parameters // set texture filtering parameters
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// load image, create texture and generate mipmaps // load image, create texture and generate mipmaps
int width, height, nrChannels; int width, height, nrChannels;
@@ -169,4 +169,4 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// make sure the viewport matches the new window dimensions; note that width and // make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays. // height will be significantly larger than specified on retina displays.
glViewport(0, 0, width, height); glViewport(0, 0, width, height);
} }