mupen64plus / mupen64plus-video-rice

Video plugin for the Mupen64Plus v2.0 project, using OpenGL. This plugin is based on the RiceVideoLinux plugin from earlier versions of Mupen64Plus.
31 stars 40 forks source link

Use `GL_NUM_EXTENSIONS` and `glGetStringi` to check OpenGL extensions #109

Closed jgcodes2020 closed 1 year ago

jgcodes2020 commented 1 year ago

According to official documentation, glGetString(GL_EXTENSIONS) will return NULL. (link)

The officially supported method goes something like:

int numExtensions = 0;
glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
for (int i = 0; i < numExtensions; i++) {
  const char* ext = (const char*) glGetStringi(GL_EXTENSIONS, i);
  // do something with ext
}

I ran into this while integrating Mupen64Plus into my own frontend.

richard42 commented 1 year ago

I believe that this documentation is referring to the Core (OpenGL 3.0) profile, whereas these video plugins are so old that they are still using the Compatibility (OpenGL 1.2) profile. So the current behavior is correct.