Mercurial > octave
changeset 21196:bd96c2efd4fe
move include statements for OpenGL headers to a single file
* oct-opengl.h: New file.
* libinterp/corefcn/module.mk: Update.
* Canvas.cc, gl-select.cc, gl-select.h, gl-render.cc, gl-render.h,
gl2ps-renderer.cc, __init_fltk__.cc, __osmesa_print__.cc:
Update include statements.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 04 Feb 2016 16:56:02 -0500 |
parents | 53ac24e210e4 |
children | 9a5bb6996b16 |
files | libgui/graphics/Canvas.cc libgui/graphics/gl-select.cc libgui/graphics/gl-select.h libinterp/corefcn/gl-render.cc libinterp/corefcn/gl-render.h libinterp/corefcn/gl2ps-renderer.cc libinterp/corefcn/module.mk libinterp/corefcn/oct-opengl.h libinterp/dldfcn/__init_fltk__.cc libinterp/dldfcn/__osmesa_print__.cc |
diffstat | 10 files changed, 71 insertions(+), 34 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/graphics/Canvas.cc Thu Feb 04 16:02:44 2016 -0500 +++ b/libgui/graphics/Canvas.cc Thu Feb 04 16:56:02 2016 -0500 @@ -42,6 +42,7 @@ #include "annotation-dialog.h" #include "gl2ps-renderer.h" +#include "oct-opengl.h" #include "octave-qt-link.h" #include "builtin-defun-decls.h"
--- a/libgui/graphics/gl-select.cc Thu Feb 04 16:02:44 2016 -0500 +++ b/libgui/graphics/gl-select.cc Thu Feb 04 16:56:02 2016 -0500 @@ -24,9 +24,9 @@ #include <config.h> #endif -#include "gl-select.h" +#include <iostream> -#include <iostream> +#include "gl-select.h" void opengl_selector::apply_pick_matrix (void)
--- a/libgui/graphics/gl-select.h Thu Feb 04 16:02:44 2016 -0500 +++ b/libgui/graphics/gl-select.h Thu Feb 04 16:56:02 2016 -0500 @@ -23,9 +23,10 @@ #ifndef __QtHandles_gl_selector__ #define __QtHandles_gl_selector__ 1 -#include "gl-render.h" +#include <map> -#include <map> +#include "gl-render.h" +#include "oct-opengl.h" enum select_flags {
--- a/libinterp/corefcn/gl-render.cc Thu Feb 04 16:02:44 2016 -0500 +++ b/libinterp/corefcn/gl-render.cc Thu Feb 04 16:56:02 2016 -0500 @@ -28,12 +28,18 @@ #include <iostream> +#ifdef HAVE_WINDOWS_H +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#endif + #include <lo-mappers.h> #include "oct-locbuf.h" #include "oct-refcount.h" #include "errwarn.h" #include "gl-render.h" +#include "oct-opengl.h" #include "txt-eng.h" #include "txt-eng-ft.h"
--- a/libinterp/corefcn/gl-render.h Thu Feb 04 16:02:44 2016 -0500 +++ b/libinterp/corefcn/gl-render.h Thu Feb 04 16:56:02 2016 -0500 @@ -23,30 +23,8 @@ #if ! defined (octave_gl_render_h) #define octave_gl_render_h 1 -#ifdef HAVE_WINDOWS_H -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#endif - -#ifdef HAVE_GL_GL_H -#include <GL/gl.h> -#elif defined HAVE_OPENGL_GL_H || defined HAVE_FRAMEWORK_OPENGL -#include <OpenGL/gl.h> -#endif - -#ifdef HAVE_GL_GLU_H -#include <GL/glu.h> -#elif defined HAVE_OPENGL_GLU_H || defined HAVE_FRAMEWORK_OPENGL -#include <OpenGL/glu.h> -#endif - -#ifdef HAVE_GL_GLEXT_H -#include <GL/glext.h> -#elif defined HAVE_OPENGL_GLEXT_H || defined HAVE_FRAMEWORK_OPENGL -#include <OpenGL/glext.h> -#endif - #include "graphics.h" +#include "oct-opengl.h" #include "txt-eng-ft.h" #if defined (HAVE_OPENGL)
--- a/libinterp/corefcn/gl2ps-renderer.cc Thu Feb 04 16:02:44 2016 -0500 +++ b/libinterp/corefcn/gl2ps-renderer.cc Thu Feb 04 16:56:02 2016 -0500 @@ -26,6 +26,7 @@ #include "error.h" #include "gl2ps-renderer.h" +#include "oct-opengl.h" #include "txt-eng-ft.h" #ifdef HAVE_GL2PS_H
--- a/libinterp/corefcn/module.mk Thu Feb 04 16:02:44 2016 -0500 +++ b/libinterp/corefcn/module.mk Thu Feb 04 16:56:02 2016 -0500 @@ -106,6 +106,9 @@ C_COREFCN_SRC = \ libinterp/corefcn/siglist.c +NOINSTALL_COREFCN_INC = \ + libinterp/corefcn/oct-opengl.h + COREFCN_SRC = \ libinterp/corefcn/Cell.cc \ libinterp/corefcn/__contourc__.cc \ @@ -247,7 +250,8 @@ libinterp/corefcn/xpow.cc \ libinterp/corefcn/zfstream.cc \ $(JIT_SRC) \ - $(C_COREFCN_SRC) + $(C_COREFCN_SRC) \ + $(NOINSTALL_COREFCN_INC) COREFCN_FT2_DF = \ libinterp/corefcn/graphics.df \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libinterp/corefcn/oct-opengl.h Thu Feb 04 16:56:02 2016 -0500 @@ -0,0 +1,44 @@ +/* + +Copyright (C) 2016 John W. Eaton + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +<http://www.gnu.org/licenses/>. + +*/ + +#if ! defined (octave_oct_opengl_h) +#define octave_oct_opengl_h 1 + +#if defined (HAVE_GL_GL_H) +# include <GL/gl.h> +#elif defined (HAVE_OPENGL_GL_H) || defined (HAVE_FRAMEWORK_OPENGL) +# include <OpenGL/gl.h> +#endif + +#if defined (HAVE_GL_GLU_H) +# include <GL/glu.h> +#elif defined (HAVE_OPENGL_GLU_H) || defined (HAVE_FRAMEWORK_OPENGL) +# include <OpenGL/glu.h> +#endif + +#if defined (HAVE_GL_GLEXT_H) +# include <GL/glext.h> +#elif defined (HAVE_OPENGL_GLEXT_H) || defined (HAVE_FRAMEWORK_OPENGL) +# include <OpenGL/glext.h> +#endif + +#endif
--- a/libinterp/dldfcn/__init_fltk__.cc Thu Feb 04 16:02:44 2016 -0500 +++ b/libinterp/dldfcn/__init_fltk__.cc Thu Feb 04 16:56:02 2016 -0500 @@ -41,12 +41,13 @@ #include "defun-dld.h" #include "error.h" #include "errwarn.h" +#include "oct-opengl.h" #include "ov-fcn-handle.h" #ifdef HAVE_FLTK #if defined (HAVE_X_WINDOWS) -#include <X11/Xlib.h> +# include <X11/Xlib.h> #endif #include <map> @@ -54,8 +55,8 @@ #include <sstream> #include <iostream> -#ifdef WIN32 -#define WIN32_LEAN_AND_MEAN +#if defined (WIN32) +# define WIN32_LEAN_AND_MEAN #endif #include <FL/Fl.H>
--- a/libinterp/dldfcn/__osmesa_print__.cc Thu Feb 04 16:02:44 2016 -0500 +++ b/libinterp/dldfcn/__osmesa_print__.cc Thu Feb 04 16:56:02 2016 -0500 @@ -31,15 +31,16 @@ #include "unwind-prot.h" #include "defun-dld.h" +#include "errwarn.h" #include "gl-render.h" #include "gl2ps-renderer.h" #include "graphics.h" -#include "errwarn.h" +#include "oct-opengl.h" #if defined (HAVE_OSMESA_H) -#include "osmesa.h" +# include "osmesa.h" #elif defined (HAVE_GL_OSMESA_H) -#include "GL/osmesa.h" +# include "GL/osmesa.h" #endif #if defined (HAVE_OSMESA) && defined (HAVE_OPENGL)