message: Fix determining available extensions for GLES
diff: @@ -384,13 +384,19 @@ void CheckExtensions(const GLHookSet &gl)
  const char *renderer = (const char *)gl.glGetString(eGL_RENDERER);
  const char *version = (const char *)gl.glGetString(eGL_VERSION);
  - RDCLOG("Vendor checks for %u (%s / %s / %s)", GLCoreVersion, vendor, renderer, version);
  -
  // check whether we are using OpenGL ES
  // GL_VERSION for OpenGL ES:
  // "OpenGL ES N.M vendor-specific information"
  if(strncmp(version, "OpenGL ES", 9) == 0)
  + {
  IsGLES = true;
  +
  + int mj = int(version[10] - '0');
  + int mn = int(version[12] - '0');
  + GLCoreVersion = mj * 10 + mn;
  + }
  +
  + RDCLOG("Vendor checks for %u (%s / %s / %s)", GLCoreVersion, vendor, renderer, version);
  }
  if(gl.glGetStringi)
  @@ -406,8 +412,7 @@ void CheckExtensions(const GLHookSet &gl)
  #undef EXT_TO_CHECK
  #define EXT_TO_CHECK(ver, glesver, extname) \
  - if((!IsGLES && GLCoreVersion >= ver) || (IsGLES && GLCoreVersion >= glesver) || \
  - !strcmp(ext, STRINGIZE(extname))) \
  + if((!IsGLES && GLCoreVersion >= ver) || !strcmp(ext, STRINGIZE(extname))) \
  HasExt[extname] = true;
  EXTENSION_CHECKS()
  @@ -422,6 +427,16 @@ void CheckExtensions(const GLHookSet &gl)
  }
  }
  }
  +
  + if(IsGLES)
  + {
  +#undef EXT_TO_CHECK
  +#define EXT_TO_CHECK(ver, glesver, extname) \
  + if(GLCoreVersion >= glesver) \
  + HasExt[extname] = true;
  +
  + EXTENSION_CHECKS()
  + }
  }
  void DoVendorChecks(const GLHookSet &gl, GLPlatform &platform, GLWindowingData context)
  