changeset 28558:c9f7d1d7a6e7 stable

gl-render.cc: Fix enumeration error. * gl-render.cc (opengl_renderer::init_maxlights): Actually query the value of GL_MAX_LIGHTS instead of using the enum directly.
author Markus Mützel <markus.muetzel@gmx.de>
date Sat, 11 Jul 2020 14:52:10 +0200
parents 26fd670f776a
children 9693beca8e06 af1a9c1db88e
files libinterp/corefcn/gl-render.cc
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/gl-render.cc	Sun Jun 14 19:57:06 2020 -0700
+++ b/libinterp/corefcn/gl-render.cc	Sat Jul 11 14:52:10 2020 +0200
@@ -4355,12 +4355,9 @@
     // Check actual maximum number of lights possible
     if (m_max_lights == 0)
       {
-        for (m_max_lights = 0; m_max_lights < GL_MAX_LIGHTS; m_max_lights++)
-          {
-            m_glfcns.glDisable (GL_LIGHT0 + m_max_lights);
-            if (m_glfcns.glGetError ())
-              break;
-          }
+        GLint max_lights;
+        m_glfcns.glGetIntegerv (GL_MAX_LIGHTS, &max_lights);
+        m_max_lights = max_lights;
       }
 
 #else