changeset 22740:3b2a30e9e49f

build: Fix building when '--without-opengl' option given (bug #49561). * gl-render.cc (draw_axes_x_grid, draw_axes_y_grid): Wrap body of functions with '#if defined (HAVE_OPENGL)' since they contain OpenGL function calls.
author Rik <rik@octave.org>
date Tue, 08 Nov 2016 15:55:10 -0800
parents d7f04f490f82
children 661cf739818c
files libinterp/corefcn/gl-render.cc
diffstat 1 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/gl-render.cc	Tue Nov 08 10:02:41 2016 -0800
+++ b/libinterp/corefcn/gl-render.cc	Tue Nov 08 15:55:10 2016 -0800
@@ -1347,6 +1347,8 @@
   void
   opengl_renderer::draw_axes_x_grid (const axes::properties& props)
   {
+#if defined (HAVE_OPENGL)
+
     int xstate = props.get_xstate ();
 
     if (props.is_visible () && xstate != AXE_DEPTH_DIR)
@@ -1494,11 +1496,24 @@
       }
     else
       gh_manager::get_object (props.get_xlabel ()).set ("visible", "off");
+
+#else
+
+    octave_unused_parameter (props);
+
+    // This shouldn't happen because construction of opengl_renderer
+    // objects is supposed to be impossible if OpenGL is not available.
+
+    panic_impossible ();
+
+#endif
   }
 
   void
   opengl_renderer::draw_axes_y_grid (const axes::properties& props)
   {
+#if defined (HAVE_OPENGL)
+
     int ystate = props.get_ystate ();
 
     if (ystate != AXE_DEPTH_DIR && props.is_visible ())
@@ -1644,6 +1659,17 @@
       }
     else
       gh_manager::get_object (props.get_ylabel ()).set ("visible", "off");
+
+#else
+
+    octave_unused_parameter (props);
+
+    // This shouldn't happen because construction of opengl_renderer
+    // objects is supposed to be impossible if OpenGL is not available.
+
+    panic_impossible ();
+
+#endif
   }
 
   void