[gtkglext] [GB#604334] Remove the gdk_gl_draw_* API functions.



commit 88925e413e8d0d86bfaf48ed5b249074bac3dcc1
Author: Braden McDaniel <braden bolt endoframe net>
Date:   Wed Dec 23 15:23:48 2009 -0500

    [GB#604334] Remove the gdk_gl_draw_* API functions.
    
    Move these to the examples directory so that the examples can still
    use them.

 docs/reference/gtkglext/gtkglext-docs.sgml    |    2 -
 docs/reference/gtkglext/gtkglext-sections.txt |   13 ---
 docs/reference/gtkglext/tmpl/gdkglshapes.sgml |  104 -------------------------
 examples/Makefile.am                          |    6 ++
 examples/button.c                             |    4 +-
 gdk/gdkglshapes.c => examples/drawshapes.c    |   67 ++++++++--------
 examples/drawshapes.h                         |   59 ++++++++++++++
 examples/shapes.c                             |   19 +++--
 gdk/Makefile.am                               |    2 -
 gdk/gdkgl.h                                   |    1 -
 gdk/gdkglshapes.h                             |   60 --------------
 11 files changed, 110 insertions(+), 227 deletions(-)
---
diff --git a/docs/reference/gtkglext/gtkglext-docs.sgml b/docs/reference/gtkglext/gtkglext-docs.sgml
index 74ada11..600a4ab 100644
--- a/docs/reference/gtkglext/gtkglext-docs.sgml
+++ b/docs/reference/gtkglext/gtkglext-docs.sgml
@@ -15,7 +15,6 @@
 <!ENTITY gtkglext-gdkglpixmap SYSTEM "xml/gdkglpixmap.xml">
 <!ENTITY gtkglext-gdkglwindow SYSTEM "xml/gdkglwindow.xml">
 <!ENTITY gtkglext-gdkglfont SYSTEM "xml/gdkglfont.xml">
-<!ENTITY gtkglext-gdkglshapes SYSTEM "xml/gdkglshapes.xml">
 <!ENTITY gtkglext-gdkglx SYSTEM "xml/gdkglx.xml">
 
 <!ENTITY gtkglext-gtkgldefs SYSTEM "xml/gtkgldefs.xml">
@@ -50,7 +49,6 @@
     &gtkglext-gdkglpixmap;
     &gtkglext-gdkglwindow;
     &gtkglext-gdkglfont;
-    &gtkglext-gdkglshapes;
     &gtkglext-gdkgltokens;
     &gtkglext-gdkglx;
     &gtkglext-gdkglversion;
diff --git a/docs/reference/gtkglext/gtkglext-sections.txt b/docs/reference/gtkglext/gtkglext-sections.txt
index f462255..c5a9ff8 100644
--- a/docs/reference/gtkglext/gtkglext-sections.txt
+++ b/docs/reference/gtkglext/gtkglext-sections.txt
@@ -192,19 +192,6 @@ gdk_gl_font_use_pango_font_for_display
 </SECTION>
 
 <SECTION>
-<FILE>gdkglshapes</FILE>
-gdk_gl_draw_cube
-gdk_gl_draw_sphere
-gdk_gl_draw_cone
-gdk_gl_draw_torus
-gdk_gl_draw_tetrahedron
-gdk_gl_draw_octahedron
-gdk_gl_draw_dodecahedron
-gdk_gl_draw_icosahedron
-gdk_gl_draw_teapot
-</SECTION>
-
-<SECTION>
 <FILE>gdkgltokens</FILE>
 GDK_GL_SUCCESS
 GDK_GL_ATTRIB_LIST_NONE
diff --git a/examples/Makefile.am b/examples/Makefile.am
index a197a4b..f3b62ed 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -62,6 +62,10 @@ noinst_PROGRAMS += simple-pbuffer-sgix
 noinst_PROGRAMS += glxinfo
 endif
 
+noinst_LTLIBRARIES = libdrawshapes.la
+libdrawshapes_la_SOURCES = drawshapes.c drawshapes.h
+libdrawshapes_la_LIBADD = $(MATH_LIB)
+
 low_level_SOURCES = low-level.c
 
 simple_SOURCES = simple.c
@@ -79,8 +83,10 @@ color_SOURCES = color.c
 font_SOURCES = font.c
 
 button_SOURCES = button.c
+button_LDADD = $(LDADD) libdrawshapes.la
 
 shapes_SOURCES = trackball.h trackball.c shapes.c
+shapes_LDADD = $(LDADD) libdrawshapes.la
 
 logo_SOURCES = trackball.h trackball.c logo-model.h logo-model.c logo.c
 EXTRA_logo_SOURCES = logo-g.c logo-t.c logo-k.c
diff --git a/examples/button.c b/examples/button.c
index 97ee034..320e30e 100644
--- a/examples/button.c
+++ b/examples/button.c
@@ -20,6 +20,8 @@
 #include <GL/gl.h>
 #include <GL/glu.h>
 
+#include "drawshapes.h"
+
 #define TIMEOUT_INTERVAL 10
 
 static gboolean animate = TRUE;
@@ -129,7 +131,7 @@ expose_event (GtkWidget      *widget,
     glMaterialfv (GL_FRONT, GL_DIFFUSE, diffuse);
     glMaterialfv (GL_FRONT, GL_SPECULAR, specular);
     glMaterialf (GL_FRONT, GL_SHININESS, shininess);
-    gdk_gl_draw_torus (TRUE, 0.3, 0.6, 30, 30);
+    draw_torus (TRUE, 0.3, 0.6, 30, 30);
   glPopMatrix ();
 
   if (gdk_gl_drawable_is_double_buffered (gldrawable))
diff --git a/gdk/gdkglshapes.c b/examples/drawshapes.c
similarity index 95%
rename from gdk/gdkglshapes.c
rename to examples/drawshapes.c
index f72abba..ff43af2 100644
--- a/gdk/gdkglshapes.c
+++ b/examples/drawshapes.c
@@ -18,10 +18,7 @@
 
 #include <math.h>
 
-#include <glib.h>
-
-#include "gdkglprivate.h"
-#include "gdkglshapes.h"
+#include "drawshapes.h"
 
 #ifdef G_OS_WIN32
 #define WIN32_LEAN_AND_MEAN 1
@@ -127,7 +124,7 @@ drawBox(GLfloat size, GLenum type)
 }
 
 /**
- * gdk_gl_draw_cube:
+ * draw_cube:
  * @solid: TRUE if the cube should be solid.
  * @size: length of cube sides.
  *
@@ -137,8 +134,8 @@ drawBox(GLfloat size, GLenum type)
  *
  **/
 void
-gdk_gl_draw_cube (gboolean solid,
-                  double   size)
+draw_cube (gboolean solid,
+           double   size)
 {
   if (solid)
     drawBox (size, GL_QUADS);
@@ -163,7 +160,7 @@ initQuadObj(void)
 }
 
 /**
- * gdk_gl_draw_sphere:
+ * draw_sphere:
  * @solid: TRUE if the sphere should be solid.
  * @radius: the radius of the sphere.
  * @slices: the number of subdivisions around the Z axis (similar to lines of
@@ -177,10 +174,10 @@ initQuadObj(void)
  *
  **/
 void
-gdk_gl_draw_sphere (gboolean solid,
-                    double   radius,
-                    int      slices,
-                    int      stacks)
+draw_sphere (gboolean solid,
+             double   radius,
+             int      slices,
+             int      stacks)
 {
   QUAD_OBJ_INIT();
 
@@ -198,7 +195,7 @@ gdk_gl_draw_sphere (gboolean solid,
 }
 
 /**
- * gdk_gl_draw_cone:
+ * draw_cone:
  * @solid: TRUE if the cone should be solid.
  * @base: the radius of the base of the cone.
  * @height: the height of the cone.
@@ -212,11 +209,11 @@ gdk_gl_draw_sphere (gboolean solid,
  *
  **/
 void
-gdk_gl_draw_cone (gboolean solid,
-                  double   base,
-                  double   height,
-                  int      slices,
-                  int      stacks)
+draw_cone (gboolean solid,
+           double   base,
+           double   height,
+           int      slices,
+           int      stacks)
 {
   QUAD_OBJ_INIT();
 
@@ -279,7 +276,7 @@ doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings)
 }
 
 /**
- * gdk_gl_draw_torus:
+ * draw_torus:
  * @solid: TRUE if the torus should be solid.
  * @inner_radius: inner radius of the torus.
  * @outer_radius: outer radius of the torus.
@@ -291,11 +288,11 @@ doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings)
  *
  **/
 void
-gdk_gl_draw_torus (gboolean solid,
-                   double   inner_radius,
-                   double   outer_radius,
-                   int      nsides,
-                   int      rings)
+draw_torus (gboolean solid,
+            double   inner_radius,
+            double   outer_radius,
+            int      nsides,
+            int      rings)
 {
   if (solid)
     {
@@ -447,7 +444,7 @@ tetrahedron(GLenum shadeType)
 }
 
 /**
- * gdk_gl_draw_tetrahedron:
+ * draw_tetrahedron:
  * @solid: TRUE if the tetrahedron should be solid.
  *
  * Renders a tetrahedron centered at the modeling coordinates
@@ -455,7 +452,7 @@ tetrahedron(GLenum shadeType)
  *
  **/
 void
-gdk_gl_draw_tetrahedron (gboolean solid)
+draw_tetrahedron (gboolean solid)
 {
   if (solid)
     tetrahedron (GL_TRIANGLES);
@@ -502,7 +499,7 @@ octahedron(GLenum shadeType)
 }
 
 /**
- * gdk_gl_draw_octahedron:
+ * draw_octahedron:
  * @solid: TRUE if the octahedron should be solid.
  *
  * Renders a octahedron centered at the modeling coordinates
@@ -510,7 +507,7 @@ octahedron(GLenum shadeType)
  *
  **/
 void
-gdk_gl_draw_octahedron (gboolean solid)
+draw_octahedron (gboolean solid)
 {
   if (solid)
     octahedron (GL_TRIANGLES);
@@ -579,7 +576,7 @@ icosahedron(GLenum shadeType)
 }
 
 /**
- * gdk_gl_draw_icosahedron:
+ * draw_icosahedron:
  * @solid: TRUE if the icosahedron should be solid.
  *
  * Renders a icosahedron.
@@ -588,7 +585,7 @@ icosahedron(GLenum shadeType)
  *
  **/
 void
-gdk_gl_draw_icosahedron (gboolean solid)
+draw_icosahedron (gboolean solid)
 {
   if (solid)
     icosahedron (GL_TRIANGLES);
@@ -679,7 +676,7 @@ dodecahedron(GLenum type)
 }
 
 /**
- * gdk_gl_draw_dodecahedron:
+ * draw_dodecahedron:
  * @solid: TRUE if the dodecahedron should be solid.
  *
  * Renders a dodecahedron centered at the modeling coordinates
@@ -687,7 +684,7 @@ dodecahedron(GLenum type)
  *
  **/
 void
-gdk_gl_draw_dodecahedron (gboolean solid)
+draw_dodecahedron (gboolean solid)
 {
   if (solid)
     dodecahedron (GL_TRIANGLE_FAN);
@@ -848,7 +845,7 @@ teapot(GLint grid, GLdouble scale, GLenum type)
 }
 
 /**
- * gdk_gl_draw_teapot:
+ * draw_teapot:
  * @solid: TRUE if the teapot should be solid.
  * @scale: relative size of the teapot.
  *
@@ -858,8 +855,8 @@ teapot(GLint grid, GLdouble scale, GLenum type)
  *
  **/
 void
-gdk_gl_draw_teapot (gboolean solid,
-                    double   scale)
+draw_teapot (gboolean solid,
+             double   scale)
 {
   if (solid)
     teapot (7, scale, GL_FILL);
diff --git a/examples/drawshapes.h b/examples/drawshapes.h
new file mode 100644
index 0000000..2b564ca
--- /dev/null
+++ b/examples/drawshapes.h
@@ -0,0 +1,59 @@
+/* GdkGLExt - OpenGL Extension to GDK
+ * Copyright (C) 2002-2004  Naofumi Yasufuku
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.
+ */
+
+#ifndef __DRAW_SHAPES_H__
+#define __DRAW_SHAPES_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+void draw_cube         (gboolean solid,
+                        double   size);
+
+void draw_sphere       (gboolean solid,
+                        double   radius,
+                        int      slices,
+                        int      stacks);
+
+void draw_cone         (gboolean solid,
+                        double   base,
+                        double   height,
+                        int      slices,
+                        int      stacks);
+
+void draw_torus        (gboolean solid,
+                        double   inner_radius,
+                        double   outer_radius,
+                        int      nsides,
+                        int      rings);
+
+void draw_tetrahedron  (gboolean solid);
+
+void draw_octahedron   (gboolean solid);
+
+void draw_dodecahedron (gboolean solid);
+
+void draw_icosahedron  (gboolean solid);
+
+void draw_teapot       (gboolean solid,
+                        double   scale);
+
+G_END_DECLS
+
+#endif /* __DRAW_SHAPES_H__ */
diff --git a/examples/shapes.c b/examples/shapes.c
index 41cb29b..6791791 100644
--- a/examples/shapes.c
+++ b/examples/shapes.c
@@ -22,6 +22,7 @@
 #include <GL/glu.h>
 
 #include "trackball.h"
+#include "drawshapes.h"
 
 #define DIG_2_RAD (G_PI / 180.0)
 #define RAD_2_DIG (180.0 / G_PI)
@@ -198,32 +199,32 @@ realize (GtkWidget *widget,
 
   /* Cube */
   glNewList (shape_list_base + shape_cube, GL_COMPILE);
-    gdk_gl_draw_cube (TRUE, 1.5);
+    draw_cube (TRUE, 1.5);
   glEndList ();
 
   /* Sphere */
   glNewList (shape_list_base + shape_sphere, GL_COMPILE);
-    gdk_gl_draw_sphere (TRUE, 1.0, 30, 30);
+    draw_sphere (TRUE, 1.0, 30, 30);
   glEndList ();
 
   /* Cone */
   glNewList (shape_list_base + shape_cone, GL_COMPILE);
     glPushMatrix ();
       glTranslatef (0.0, 0.0, -1.0);
-      gdk_gl_draw_cone (TRUE, 1.0, 2.0, 30, 30);
+      draw_cone (TRUE, 1.0, 2.0, 30, 30);
     glPopMatrix ();
   glEndList ();
 
   /* Torus */
   glNewList (shape_list_base + shape_torus, GL_COMPILE);
-    gdk_gl_draw_torus (TRUE, 0.4, 0.8, 30, 30);
+    draw_torus (TRUE, 0.4, 0.8, 30, 30);
   glEndList ();
 
   /* Tetrahedron */
   glNewList (shape_list_base + shape_tetrahedron, GL_COMPILE);
     glPushMatrix ();
       glScalef (1.2, 1.2, 1.2);
-      gdk_gl_draw_tetrahedron (TRUE);
+      draw_tetrahedron (TRUE);
     glPopMatrix ();
   glEndList ();
 
@@ -231,7 +232,7 @@ realize (GtkWidget *widget,
   glNewList (shape_list_base + shape_octahedron, GL_COMPILE);
     glPushMatrix ();
       glScalef (1.2, 1.2, 1.2);
-      gdk_gl_draw_octahedron (TRUE);
+      draw_octahedron (TRUE);
     glPopMatrix ();
   glEndList ();
 
@@ -239,7 +240,7 @@ realize (GtkWidget *widget,
   glNewList (shape_list_base + shape_dodecahedron, GL_COMPILE);
     glPushMatrix ();
       glScalef (0.7, 0.7, 0.7);
-      gdk_gl_draw_dodecahedron (TRUE);
+      draw_dodecahedron (TRUE);
     glPopMatrix ();
   glEndList ();
 
@@ -247,13 +248,13 @@ realize (GtkWidget *widget,
   glNewList (shape_list_base + shape_icosahedron, GL_COMPILE);
     glPushMatrix ();
       glScalef (1.2, 1.2, 1.2);
-      gdk_gl_draw_icosahedron (TRUE);
+      draw_icosahedron (TRUE);
     glPopMatrix ();
   glEndList ();
 
   /* Teapot */
   glNewList (shape_list_base + shape_teapot, GL_COMPILE);
-    gdk_gl_draw_teapot (TRUE, 1.0);
+    draw_teapot (TRUE, 1.0);
   glEndList ();
 
   gdk_gl_drawable_gl_end (gldrawable);
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index 45caa9c..57039b0 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -75,7 +75,6 @@ gdkglext_public_h_sources = \
 	gdkglpixmap.h		\
 	gdkglwindow.h		\
 	gdkglfont.h		\
-	gdkglshapes.h		\
 	gdkglglext.h
 
 gdkglext_private_h_sources = \
@@ -93,7 +92,6 @@ gdkglext_c_sources = \
 	gdkgldrawable.c		\
 	gdkglpixmap.c		\
 	gdkglwindow.c		\
-	gdkglshapes.c		\
 	gdkglglext.c
 
 gdkglext_built_c_sources = \
diff --git a/gdk/gdkgl.h b/gdk/gdkgl.h
index f22a31c..c88a0ae 100644
--- a/gdk/gdkgl.h
+++ b/gdk/gdkgl.h
@@ -34,6 +34,5 @@
 #include <gdk/gdkglpixmap.h>
 #include <gdk/gdkglwindow.h>
 #include <gdk/gdkglfont.h>
-#include <gdk/gdkglshapes.h>
 
 #endif /* __GDK_GL_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]