changeset 22258:553490ffc203

Fix compile error and warning with '--without-opengl' (bug #48724) * gl-render.cc (get_maxlights): Define conditionally on HAVE_OPENGL. (opengl_renderer::draw_all_lights): Add conditional on HAVE_OPENGL.
author Markus Mützel <markus.muetzel@gmx.de>
date Tue, 09 Aug 2016 14:41:32 +0200
parents 945e7f9c11ff
children 22f45a6b4693
files libinterp/corefcn/gl-render.cc
diffstat 1 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/gl-render.cc	Wed Aug 10 10:59:14 2016 -0700
+++ b/libinterp/corefcn/gl-render.cc	Tue Aug 09 14:41:32 2016 +0200
@@ -587,10 +587,11 @@
 
 #endif
 
+#if defined (HAVE_OPENGL)
+
 static int
 get_maxlights (void)
 {
-#if defined (HAVE_OPENGL)
 
   static int max_lights = 0;
 
@@ -606,14 +607,11 @@
     }
 
   return max_lights;
-#else
-
-  err_disabled_feature ("opengl_renderer", "OpenGL");
+
+}
 
 #endif
 
-}
-
 opengl_renderer::opengl_renderer (void)
   : toolkit (), xform (), xmin (), xmax (), ymin (), ymax (),
     zmin (), zmax (), xZ1 (), xZ2 (), marker_id (), filled_marker_id (),
@@ -1650,6 +1648,7 @@
 void
 opengl_renderer::draw_all_lights (const base_properties& props, std::list<graphics_object>& obj_list)
 {
+#if defined (HAVE_OPENGL)
   Matrix children = props.get_all_children ();
 
   for (octave_idx_type i = children.numel () - 1; i >= 0; i--)
@@ -1678,6 +1677,17 @@
             obj_list.push_back (go);
         }
     }
+#else
+
+  octave_unused_parameter (props);
+  octave_unused_parameter (obj_list);
+
+  // This shouldn't happen because construction of opengl_renderer
+  // objects is supposed to be impossible if OpenGL is not available.
+
+  panic_impossible ();
+
+#endif
 }
 
 void