[grits] Move OpenGL includes to a common place
- From: Andy Spencer <andys src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grits] Move OpenGL includes to a common place
- Date: Tue, 3 Jan 2012 01:21:14 +0000 (UTC)
commit ce0016070b1fe7db3bd208d6148a776efd3f7d6e
Author: Andy Spencer <andy753421 gmail com>
Date: Mon Dec 12 05:37:20 2011 +0000
Move OpenGL includes to a common place
Apple seems to think the should put GL.h in OpenGL instead of GL..
putting it all gtkgl.h makes it a little easier, but requires gtkgl.h to
be included in the install and by grits.h.
src/Makefile.am | 1 +
src/grits-opengl.c | 2 --
src/grits.h | 3 +++
src/gtkgl.h | 11 +++++++++++
src/objects/grits-marker.c | 2 +-
src/objects/grits-object.c | 2 +-
src/objects/grits-poly.c | 3 +--
src/objects/grits-tile.c | 2 +-
src/objects/grits-volume.c | 2 +-
src/plugins/elev.c | 1 -
src/plugins/env.c | 1 -
src/plugins/map.c | 1 -
src/plugins/sat.c | 1 -
src/plugins/test.c | 3 ---
src/roam.c | 3 +--
15 files changed, 21 insertions(+), 17 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 18659d3..ed3db86 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -17,6 +17,7 @@ grits_include_HEADERS = \
grits-opengl.h \
grits-plugin.h \
grits-util.h \
+ gtkgl.h \
gpqueue.h \
roam.h
diff --git a/src/grits-opengl.c b/src/grits-opengl.c
index 59fea09..a39fbda 100644
--- a/src/grits-opengl.c
+++ b/src/grits-opengl.c
@@ -32,8 +32,6 @@
#include <string.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
-#include <GL/gl.h>
-#include <GL/glu.h>
#include "grits-opengl.h"
#include "grits-util.h"
diff --git a/src/grits.h b/src/grits.h
index 84ae7ed..523d87c 100644
--- a/src/grits.h
+++ b/src/grits.h
@@ -40,4 +40,7 @@
/* Plugins */
#include <grits-plugin.h>
+/* Misc */
+#include <gtkgl.h>
+
#endif
diff --git a/src/gtkgl.h b/src/gtkgl.h
index 174fc76..71ad67a 100644
--- a/src/gtkgl.h
+++ b/src/gtkgl.h
@@ -18,6 +18,17 @@
#ifndef __GTK_GL_H__
#define __GTK_GL_H__
+#include <gtk/gtk.h>
+
+/* Platform dependant OpenGL includes */
+#ifdef USE_MAC
+#include <OpenGL/gl.h>
+#include <OpenGL/glu.h>
+#else
+#include <GL/gl.h>
+#include <GL/glu.h>
+#endif
+
/* Call before widget is realized */
void gtk_gl_enable(GtkWidget *widget);
diff --git a/src/objects/grits-marker.c b/src/objects/grits-marker.c
index a5cb9c7..3946775 100644
--- a/src/objects/grits-marker.c
+++ b/src/objects/grits-marker.c
@@ -31,7 +31,7 @@
*/
#include <config.h>
-#include <GL/gl.h>
+#include "gtkgl.h"
#include "grits-marker.h"
/**
diff --git a/src/objects/grits-object.c b/src/objects/grits-object.c
index 30f79f9..fc8cddf 100644
--- a/src/objects/grits-object.c
+++ b/src/objects/grits-object.c
@@ -30,8 +30,8 @@
#include <config.h>
#include <math.h>
-#include <GL/gl.h>
+#include "gtkgl.h"
#include "grits-object.h"
/* Constants */
diff --git a/src/objects/grits-poly.c b/src/objects/grits-poly.c
index 67dca9a..5d54a70 100644
--- a/src/objects/grits-poly.c
+++ b/src/objects/grits-poly.c
@@ -23,8 +23,7 @@
*/
#include <config.h>
-#include <GL/gl.h>
-#include <GL/glu.h>
+#include "gtkgl.h"
#include "grits-poly.h"
/* Drawing */
diff --git a/src/objects/grits-tile.c b/src/objects/grits-tile.c
index bceb2a3..c8326da 100644
--- a/src/objects/grits-tile.c
+++ b/src/objects/grits-tile.c
@@ -33,7 +33,7 @@
*/
#include <config.h>
-#include <GL/gl.h>
+#include "gtkgl.h"
#include "grits-tile.h"
gchar *grits_tile_path_table[2][2] = {
diff --git a/src/objects/grits-volume.c b/src/objects/grits-volume.c
index 2579600..f972fe5 100644
--- a/src/objects/grits-volume.c
+++ b/src/objects/grits-volume.c
@@ -29,7 +29,7 @@
#include <config.h>
#include <math.h>
#include <glib.h>
-#include <GL/gl.h>
+#include "gtkgl.h"
#include "grits-volume.h"
/* Drawing */
diff --git a/src/plugins/elev.c b/src/plugins/elev.c
index cf3f3fb..d8c6456 100644
--- a/src/plugins/elev.c
+++ b/src/plugins/elev.c
@@ -26,7 +26,6 @@
*/
#include <glib/gstdio.h>
-#include <GL/gl.h>
#include <grits.h>
diff --git a/src/plugins/env.c b/src/plugins/env.c
index cdafb5c..75e41d3 100644
--- a/src/plugins/env.c
+++ b/src/plugins/env.c
@@ -25,7 +25,6 @@
*/
#include <math.h>
-#include <GL/gl.h>
#include <grits.h>
diff --git a/src/plugins/map.c b/src/plugins/map.c
index 31412d2..0e8a656 100644
--- a/src/plugins/map.c
+++ b/src/plugins/map.c
@@ -25,7 +25,6 @@
#include <time.h>
#include <glib/gstdio.h>
-#include <GL/gl.h>
#include <grits.h>
diff --git a/src/plugins/sat.c b/src/plugins/sat.c
index 0640c52..1c738d9 100644
--- a/src/plugins/sat.c
+++ b/src/plugins/sat.c
@@ -25,7 +25,6 @@
#include <time.h>
#include <glib/gstdio.h>
-#include <GL/gl.h>
#include <grits.h>
diff --git a/src/plugins/test.c b/src/plugins/test.c
index 2c11ea9..d0315bd 100644
--- a/src/plugins/test.c
+++ b/src/plugins/test.c
@@ -25,9 +25,6 @@
#include <string.h>
-#include <GL/gl.h>
-#include <GL/glu.h>
-
#include <gdk/gdkkeysyms.h>
#include <grits.h>
diff --git a/src/roam.c b/src/roam.c
index 69c75f2..cfcdd54 100644
--- a/src/roam.c
+++ b/src/roam.c
@@ -31,9 +31,8 @@
#include <glib.h>
#include <math.h>
#include <string.h>
-#include <GL/gl.h>
-#include <GL/glu.h>
+#include "gtkgl.h"
#include "gpqueue.h"
#include "grits-util.h"
#include "roam.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]