# HG changeset patch # User Markus Mützel # Date 1594471930 -7200 # Node ID c9f7d1d7a6e7f5b448bb9c7c9987ceab4676ecd7 # Parent 26fd670f776abed862bc6961d9a9b5d06eb0396d 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. diff -r 26fd670f776a -r c9f7d1d7a6e7 libinterp/corefcn/gl-render.cc --- 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