瀏覽代碼

REVIEWED: `rlLoadTeexture()`, max mipmap levels to use #5400

pull/5402/head
Ray 1 周之前
父節點
當前提交
3adfde42f7
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. +4
    -2
      src/rlgl.h

+ 4
- 2
src/rlgl.h 查看文件

@ -3384,10 +3384,12 @@ unsigned int rlLoadTexture(const void *data, int width, int height, int format,
#if defined(GRAPHICS_API_OPENGL_33)
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_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

Loading…
取消
儲存