mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-12 09:32:42 +00:00
REVIEWED: rlLoadTeexture(), max mipmap levels to use #5400
This commit is contained in:
@@ -3384,10 +3384,12 @@ unsigned int rlLoadTexture(const void *data, int width, int height, int format,
|
|||||||
#if defined(GRAPHICS_API_OPENGL_33)
|
#if defined(GRAPHICS_API_OPENGL_33)
|
||||||
if (mipmapCount > 1)
|
if (mipmapCount > 1)
|
||||||
{
|
{
|
||||||
// Activate Trilinear filtering if mipmaps are available
|
// Activate trilinear filtering if mipmaps are available
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, mipmapCount); // Required for user-defined mip count
|
|
||||||
|
// Define thee maximum number of mipmap levels to be used, 0 is default texture size
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, mipmapCount - 1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user