projectM-visualizer / projectm

projectM - Cross-platform Music Visualization Library. Open-source and Milkdrop-compatible.
https://discord.gg/mMrxAqaa3W
GNU Lesser General Public License v2.1
3.22k stars 364 forks source link

Fix shading language version detection when using WebGL #746

Closed kblaschke closed 7 months ago

kblaschke commented 7 months ago

WebGL doesn't follow the OpenGL standard format for the glGetString(GL_SHADING_LANGUAGE_VERSION) return value. Chrome for example will return "OpenGL ES GLSL ES 3.00 (WebGL GLSL ES 3.00 (OpenGL ES GLSL ES 3.0 Chromium))", which does not start with the version number as the standard suggests.

This fix will simply cut off any text preceding the first digit found in the string, if any.

kblaschke commented 7 months ago

Merged.