glGetString(GL_EXTENSIONS) may return null in core contexts
xcode project missing update
This commit is contained in:
parent
9d6c548730
commit
2dd7717128
|
@ -109,7 +109,7 @@ bool CustomTexture::Init()
|
|||
DIR *dir = flycast::opendir(textures_path.c_str());
|
||||
if (dir != nullptr)
|
||||
{
|
||||
INFO_LOG(RENDERER, "Found custom textures directory: %s", textures_path.c_str());
|
||||
NOTICE_LOG(RENDERER, "Found custom textures directory: %s", textures_path.c_str());
|
||||
custom_textures_available = true;
|
||||
flycast::closedir(dir);
|
||||
loader_thread.Start();
|
||||
|
|
|
@ -488,17 +488,28 @@ void findGLVersion()
|
|||
#if !defined(GLES2)
|
||||
if (gl.gl_major >= 3)
|
||||
{
|
||||
for (u32 i = 0; ; i++)
|
||||
bool anisotropicExtension = false;
|
||||
const char *extensions = (const char *)glGetString(GL_EXTENSIONS);
|
||||
// glGetString(GL_EXTENSIONS) is deprecated and might return NULL in core contexts.
|
||||
// In that case, use glGetStringi instead
|
||||
if (extensions == nullptr)
|
||||
{
|
||||
const char* extension = (const char *)glGetStringi(GL_EXTENSIONS, i);
|
||||
if (extension == nullptr)
|
||||
break;
|
||||
if (!strcmp(extension, "GL_EXT_texture_filter_anisotropic"))
|
||||
GLint n = 0;
|
||||
glGetIntegerv(GL_NUM_EXTENSIONS, &n);
|
||||
for (GLint i = 0; i < n; i++)
|
||||
{
|
||||
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY, &gl.max_anisotropy);
|
||||
break;
|
||||
const char* extension = (const char *)glGetStringi(GL_EXTENSIONS, i);
|
||||
if (!strcmp(extension, "GL_EXT_texture_filter_anisotropic"))
|
||||
{
|
||||
anisotropicExtension = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (strstr(extensions, "GL_EXT_texture_filter_anisotropic") != nullptr)
|
||||
anisotropicExtension = true;
|
||||
if (anisotropicExtension)
|
||||
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY, &gl.max_anisotropy);
|
||||
}
|
||||
#endif
|
||||
gl.mesa_nouveau = strstr((const char *)glGetString(GL_VERSION), "Mesa") != nullptr && !strcmp((const char *)glGetString(GL_VENDOR), "nouveau");
|
||||
|
|
|
@ -520,7 +520,6 @@
|
|||
84B7BE131B72720100F9733F /* decoder_opcodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = decoder_opcodes.h; sourceTree = "<group>"; };
|
||||
84B7BE141B72720100F9733F /* driver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = driver.cpp; sourceTree = "<group>"; };
|
||||
84B7BE151B72720100F9733F /* ngen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ngen.h; sourceTree = "<group>"; };
|
||||
84B7BE171B72720100F9733F /* regalloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = regalloc.h; sourceTree = "<group>"; };
|
||||
84B7BE181B72720100F9733F /* shil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = shil.cpp; sourceTree = "<group>"; };
|
||||
84B7BE191B72720100F9733F /* shil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shil.h; sourceTree = "<group>"; };
|
||||
84B7BE1A1B72720100F9733F /* shil_canonical.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shil_canonical.h; sourceTree = "<group>"; };
|
||||
|
@ -1675,7 +1674,6 @@
|
|||
84B7BE131B72720100F9733F /* decoder_opcodes.h */,
|
||||
84B7BE141B72720100F9733F /* driver.cpp */,
|
||||
84B7BE151B72720100F9733F /* ngen.h */,
|
||||
84B7BE171B72720100F9733F /* regalloc.h */,
|
||||
84B7BE181B72720100F9733F /* shil.cpp */,
|
||||
84B7BE191B72720100F9733F /* shil.h */,
|
||||
84B7BE1A1B72720100F9733F /* shil_canonical.h */,
|
||||
|
|
Loading…
Reference in New Issue