diff libinterp/corefcn/gl-render.cc @ 24725:edef866fba7b

* gl-render.cc: Fix compilation error when HAVE_OPENGL is not defined.
author John W. Eaton <jwe@octave.org>
date Sat, 10 Feb 2018 15:45:22 -0500
parents af6c1ed60581
children 8585b3f9c28c
line wrap: on
line diff
--- a/libinterp/corefcn/gl-render.cc	Sat Feb 10 08:33:17 2018 +0100
+++ b/libinterp/corefcn/gl-render.cc	Sat Feb 10 15:45:22 2018 -0500
@@ -40,10 +40,10 @@
 #include "oct-opengl.h"
 #include "text-renderer.h"
 
-#if defined (HAVE_OPENGL)
-
 namespace octave
 {
+#if defined (HAVE_OPENGL)
+
   static int
   next_power_of_2 (int n)
   {
@@ -589,29 +589,6 @@
 
 #endif
 
-#if defined (HAVE_OPENGL)
-
-  static int
-  get_maxlights (void)
-  {
-    static int max_lights = 0;
-
-    // Check actual maximum number of lights possible
-    if (max_lights == 0)
-      {
-        for (max_lights = 0; max_lights < GL_MAX_LIGHTS; max_lights++)
-          {
-            glDisable (GL_LIGHT0 + max_lights);
-            if (glGetError ())
-              break;
-          }
-      }
-
-    return max_lights;
-  }
-
-#endif
-
   opengl_renderer::opengl_renderer (void)
     : toolkit (), xform (), xmin (), xmax (), ymin (), ymax (),
       zmin (), zmax (), xZ1 (), xZ2 (), marker_id (), filled_marker_id (),
@@ -1996,6 +1973,29 @@
 #endif
   }
 
+#if defined (HAVE_OPENGL)
+
+  static int
+  get_maxlights (void)
+  {
+    static int max_lights = 0;
+
+    // Check actual maximum number of lights possible
+    if (max_lights == 0)
+      {
+        for (max_lights = 0; max_lights < GL_MAX_LIGHTS; max_lights++)
+          {
+            glDisable (GL_LIGHT0 + max_lights);
+            if (glGetError ())
+              break;
+          }
+      }
+
+    return max_lights;
+  }
+
+#endif
+
   void
   opengl_renderer::draw_axes_children (const axes::properties& props)
   {