Skip to content

Commit

Permalink
Revise glGenerateMipmap detection:
Browse files Browse the repository at this point in the history
Link to glGenerateMipmap if gl_version >= 3 or GL_ARB_framebuffer_object
is present. Fallback to glGenerateMipmapEXT if GL_EXT_framebuffer_object
is present.
  • Loading branch information
sezero committed Aug 18, 2023
1 parent 7f5deec commit 87ebe3a
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Quake/gl_vidsdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1303,10 +1303,19 @@ static void GL_CheckExtensions (void)
Con_Warning ("glGenerateMipmap disabled at command line\n");
else
{
GL_GenerateMipmap = (QS_PFNGENERATEMIPMAP) SDL_GL_GetProcAddress("glGenerateMipmap");
if (GL_GenerateMipmap != NULL)
Con_Printf ("FOUND: glGenerateMipmap\n");
else
if (gl_version_major >= 3 || GL_ParseExtensionList(gl_extensions, "GL_ARB_framebuffer_object"))
{
GL_GenerateMipmap = (QS_PFNGENERATEMIPMAP) SDL_GL_GetProcAddress("glGenerateMipmap");
if (GL_GenerateMipmap != NULL)
Con_Printf ("FOUND: glGenerateMipmap\n");
}
else if (GL_ParseExtensionList(gl_extensions, "GL_EXT_framebuffer_object"))
{
GL_GenerateMipmap = (QS_PFNGENERATEMIPMAP) SDL_GL_GetProcAddress("glGenerateMipmapEXT");
if (GL_GenerateMipmap != NULL)
Con_Printf ("FOUND: glGenerateMipmapEXT\n");
}
if (GL_GenerateMipmap == NULL)
Con_Warning ("glGenerateMipmap not available, liquids won't have mipmaps\n");
}
}
Expand Down

0 comments on commit 87ebe3a

Please sign in to comment.