mirror of https://github.com/snes9xgit/snes9x.git
Use some more compatible OpenGL version checking.
This commit is contained in:
parent
78bc52cd8e
commit
171a20cb6d
|
@ -35,14 +35,14 @@ bool gl_version_at_least (int maj, int min)
|
|||
|
||||
if (major_version < 0 || minor_version < 0)
|
||||
{
|
||||
glGetIntegerv (GL_MAJOR_VERSION, &major_version);
|
||||
glGetIntegerv (GL_MINOR_VERSION, &minor_version);
|
||||
const char *version_string = (const char *) glGetString (GL_VERSION);
|
||||
sscanf (version_string, "%d.%d", &major_version, &minor_version);
|
||||
}
|
||||
|
||||
if (maj > major_version)
|
||||
if (major_version > maj)
|
||||
return true;
|
||||
|
||||
if (maj == major_version && min >= minor_version)
|
||||
if (maj == major_version && minor_version >= min)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -953,12 +953,13 @@ bool COpenGL::ShaderAailable()
|
|||
bool COpenGL::NPOTAvailable()
|
||||
{
|
||||
const char *extensions = (const char *)glGetString(GL_EXTENSIONS);
|
||||
const char *version = (const char *)glGetString(GL_VERSION);
|
||||
|
||||
if (!extensions)
|
||||
return false;
|
||||
|
||||
int glVersionMajor = 0;
|
||||
glGetIntegerv(GL_MAJOR_VERSION, &glVersionMajor);
|
||||
glVersionMajor = atoi (version);
|
||||
|
||||
if (glVersionMajor >= 2)
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue