[gtkglarea/jjardon/namespace_change: 4/4] examples: Port to new name space



commit b501f284f9cefbec80d16976941b152d867d346d
Author: Javier Jardón <jjardon gnome org>
Date:   Wed Mar 26 20:55:18 2014 +0000

    examples: Port to new name space

 examples/gtkglarea_demo.c |   64 ++++++++++++++++++++++----------------------
 examples/shaders.c        |   38 +++++++++++++-------------
 examples/simple.c         |   28 ++++++++++----------
 examples/viewlw.c         |   28 ++++++++++----------
 examples/zktor.c          |   30 ++++++++++----------
 5 files changed, 94 insertions(+), 94 deletions(-)
---
diff --git a/examples/gtkglarea_demo.c b/examples/gtkglarea_demo.c
index c0ee052..21cdd8b 100644
--- a/examples/gtkglarea_demo.c
+++ b/examples/gtkglarea_demo.c
@@ -19,9 +19,9 @@
  ******************************************************************************
  *
  * This is a short, heavily commented demo program designed to help
- * get you started using the GtkGLArea widget in your gtk programs.
+ * get you started using the GglaWidget widget in your gtk programs.
  *
- * The program creates a window with a GtkGLArea widget and a quit button.
+ * The program creates a window with a GglaWidget widget and a quit button.
  * Some commonly used callbacks are registered, but nothing is drawn into
  * the window.
  *
@@ -76,7 +76,7 @@ GtkWidget* create_glarea (void) {
 
   /* Choose the attributes that we would like for our visual. */
   /* These attributes are passed to glXChooseVisual by the    */
-  /* gdk (see gdk_gl_choose_visual in gdkgl.c from the        */
+  /* gdk (see ggla_choose_visual in gdkgl.c from the        */
   /* GtkGlarea distro).                                       */
   /*                                                          */
   /*                                                          */
@@ -90,25 +90,25 @@ GtkWidget* create_glarea (void) {
   /* and their descriptions.                                  */
 
   int attrlist[] = {
-    GDK_GL_RGBA,
-    GDK_GL_DOUBLEBUFFER,
-    GDK_GL_DEPTH_SIZE, 1,
-    GDK_GL_NONE
+    GGLA_RGBA,
+    GGLA_DOUBLEBUFFER,
+    GGLA_DEPTH_SIZE, 1,
+    GGLA_NONE
   };
 
   /* First things first! Make sure that OpenGL is supported   */
   /* before trying to do OpenGL stuff!                        */
 
-  if(gdk_gl_query() == FALSE) {
+  if(ggla_query() == FALSE) {
     g_print("OpenGL not supported!\n");
     return NULL;
   }
 
-  /* Now, create the GtkGLArea using the attribute list that  */
+  /* Now, create the GglaWidget using the attribute list that  */
   /* we defined above.                                        */
 
-  if ((glarea = gtk_gl_area_new(attrlist)) == NULL) {
-    g_print("Error creating GtkGLArea!\n");
+  if ((glarea = ggla_widget_new(attrlist)) == NULL) {
+    g_print("Error creating GglaWidget!\n");
     return NULL;
   }
 
@@ -173,7 +173,7 @@ GtkWidget* create_glarea (void) {
   /* destroy - The window has received a destroy event, this  */
   /*           is where you should do any cleanup that needs  */
   /*           to happen, such as de-allocating data objects  */
-  /*           that you have added to your GtkGLArea.         */
+  /*           that you have added to your GglaWidget.         */
 
   g_signal_connect (G_OBJECT(glarea), "destroy",
                     G_CALLBACK (glarea_destroy), NULL);
@@ -188,7 +188,7 @@ GtkWidget* create_glarea (void) {
 /*                                                                           */
 /* Function: glarea_button_release (GtkWidget*, GdkEventButton*)             */
 /*                                                                           */
-/* This function handles button-release events for the GtkGLArea into which  */
+/* This function handles button-release events for the GglaWidget into which  */
 /* we are drawing.                                                           */
 /*                                                                           */
 /*****************************************************************************/
@@ -224,7 +224,7 @@ gint glarea_button_release (GtkWidget* widget, GdkEventButton* event) {
 /*                                                                           */
 /* Function: glarea_button_press (GtkWidget*, GdkEventButton*)               */
 /*                                                                           */
-/* This function handles button-press events for the GtkGLArea into which we */
+/* This function handles button-press events for the GglaWidget into which we */
 /* are drawing.                                                              */
 /*                                                                           */
 /*****************************************************************************/
@@ -259,7 +259,7 @@ gint glarea_button_press (GtkWidget* widget, GdkEventButton* event) {
 /*                                                                           */
 /* Function: glarea_motion_notify (GtkWidget*, GdkEventMotion*)              */
 /*                                                                           */
-/* This function handles motion events for the GtkGLArea into which we are   */
+/* This function handles motion events for the GglaWidget into which we are   */
 /* drawing                                                                   */
 /*                                                                           */
 /*****************************************************************************/
@@ -303,7 +303,7 @@ gint glarea_motion_notify (GtkWidget* widget, GdkEventMotion* event) {
 /*                                                                           */
 /* Function: glarea_draw (GtkWidget*, cairo_t *cr, gpointer user_data)       */
 /*                                                                           */
-/* This is the function that should render your scene to the GtkGLArea. It   */
+/* This is the function that should render your scene to the GglaWidget. It   */
 /* can be used as a callback to the 'draw' signal.                           */
 /*                                                                           */
 /*****************************************************************************/
@@ -312,10 +312,10 @@ gboolean glarea_draw (GtkWidget* widget, cairo_t *cr, gpointer user_data) {
 
   g_print ("Draw Signal\n");
 
-  /* gtk_gl_area_make_current MUST be called before rendering */
-  /* into the GtkGLArea.                                      */
+  /* ggla_widget_make_current MUST be called before rendering */
+  /* into the GglaWidget.                                      */
 
-  if (gtk_gl_area_make_current(GTK_GL_AREA(widget))) {
+  if (ggla_widget_make_current(GGLA_WIDGET(widget))) {
 
     /* Clear the drawing color buffer and depth buffers */
     /* before drawing.                                  */
@@ -331,7 +331,7 @@ gboolean glarea_draw (GtkWidget* widget, cairo_t *cr, gpointer user_data) {
     /* book if you don't already have an understanding of   */
     /* single vs. double buffered windows.                  */
 
-    gtk_gl_area_swap_buffers (GTK_GL_AREA(widget));
+    ggla_widget_swap_buffers (GGLA_WIDGET(widget));
 
   }
 
@@ -344,7 +344,7 @@ gboolean glarea_draw (GtkWidget* widget, cairo_t *cr, gpointer user_data) {
 /* Function: glarea_reshape (GtkWidget*, GdkEventConfigure*)                 */
 /*                                                                           */
 /* This function performs the operations needed to maintain the viewing area */
-/* of the GtkGLArea. This should be called whenever the size of the area     */
+/* of the GglaWidget. This should be called whenever the size of the area     */
 /* is changed.                                                               */
 /*                                                                           */
 /*****************************************************************************/
@@ -358,10 +358,10 @@ gint glarea_reshape (GtkWidget* widget, GdkEventConfigure* event) {
 
   g_print ("Reshape Event\n");
 
-  /* gtk_gl_area_make_current MUST be called before rendering */
-  /* into the GtkGLArea.                                      */
+  /* ggla_widget_make_current MUST be called before rendering */
+  /* into the GglaWidget.                                      */
 
-  if (gtk_gl_area_make_current (GTK_GL_AREA(widget))) {
+  if (ggla_widget_make_current (GGLA_WIDGET(widget))) {
 
     /* This is an example 2D reshape function. Writing reshape */
     /* functions is beyond the scope of this demo. Check the   */
@@ -384,7 +384,7 @@ gint glarea_reshape (GtkWidget* widget, GdkEventConfigure* event) {
 /*                                                                           */
 /* Function: glarea_init (GtkWidget*)                                        */
 /*                                                                           */
-/* This function is a callback for the realization of the GtkGLArea widtget. */
+/* This function is a callback for the realization of the GglaWidget widtget. */
 /* You should do any OpenGL initialization here.                             */
 /*                                                                           */
 /*****************************************************************************/
@@ -393,10 +393,10 @@ gint glarea_init (GtkWidget* widget) {
 
   g_print ("Realize Event\n");
 
-  /* gtk_gl_area_make_current MUST be called before rendering */
-  /* into the GtkGLArea.                                      */
+  /* ggla_widget_make_current MUST be called before rendering */
+  /* into the GglaWidget.                                      */
 
-  if (gtk_gl_area_make_current (GTK_GL_AREA(widget))) {
+  if (ggla_widget_make_current (GGLA_WIDGET(widget))) {
 
     /* Insert your OpenGL initialization code here */
 
@@ -410,8 +410,8 @@ gint glarea_init (GtkWidget* widget) {
 /*                                                                           */
 /* Function: glarea_destroy (GtkWidget*)                                     */
 /*                                                                           */
-/* This function is a callback for the main GtkGLArea. It deletes should     */
-/* delete any data structures stored in the GtkGLArea.                       */
+/* This function is a callback for the main GglaWidget. It deletes should     */
+/* delete any data structures stored in the GglaWidget.                       */
 /*                                                                           */
 /*****************************************************************************/
 
@@ -431,7 +431,7 @@ gint glarea_destroy (GtkWidget* widget) {
 /* Function: main (int, char**)                                              */
 /*                                                                           */
 /* The main function sets up our GUI and calls the functions needed to       */
-/* create our GtkGLArea.                                                     */
+/* create our GglaWidget.                                                     */
 /*                                                                           */
 /*****************************************************************************/
 
@@ -463,7 +463,7 @@ int main (int argc, char** argv) {
 
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
-  gtk_window_set_title (GTK_WINDOW(window), "GtkGLArea Demo");
+  gtk_window_set_title (GTK_WINDOW(window), "GglaWidget Demo");
 
   g_signal_connect (G_OBJECT(window), "delete-event",
                     G_CALLBACK(gtk_main_quit), NULL);
diff --git a/examples/shaders.c b/examples/shaders.c
index 684615a..b1271d6 100644
--- a/examples/shaders.c
+++ b/examples/shaders.c
@@ -19,7 +19,7 @@
  *                                                                            *
  ******************************************************************************
  *
- * This program creates a window with a GtkGLArea widget using a Vertex
+ * This program creates a window with a GglaWidget widget using a Vertex
  * Shader and a Fragment shader. It should display a coloured texture. A
  * grayscale result means the shaders are not supported.
  *
@@ -227,19 +227,19 @@ GtkWidget* create_glarea (void) {
   GtkWidget* glarea;
 
   int attrlist[] = {
-    GDK_GL_RGBA,
-    GDK_GL_DOUBLEBUFFER,
-    GDK_GL_DEPTH_SIZE, 1,
-    GDK_GL_NONE
+    GGLA_RGBA,
+    GGLA_DOUBLEBUFFER,
+    GGLA_DEPTH_SIZE, 1,
+    GGLA_NONE
   };
 
-  if(gdk_gl_query() == FALSE) {
+  if(ggla_query() == FALSE) {
     g_print("OpenGL not supported!\n");
     return NULL;
   }
 
-  if ((glarea = gtk_gl_area_new(attrlist)) == NULL) {
-    g_print("Error creating GtkGLArea!\n");
+  if ((glarea = ggla_widget_new(attrlist)) == NULL) {
+    g_print("Error creating GglaWidget!\n");
     return NULL;
   }
 
@@ -288,18 +288,18 @@ gint glarea_draw_scene (void) {
 /*                                                                           */
 /* Function: glarea_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)*/
 /*                                                                           */
-/* This is the function that should render your scene to the GtkGLArea. It   */
+/* This is the function that should render your scene to the GglaWidget. It   */
 /* can be used as a callback to the 'draw' signal.                           */
 /*                                                                           */
 /*****************************************************************************/
 
 gboolean glarea_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data) {
 
-  if (gtk_gl_area_make_current(GTK_GL_AREA(widget))) {
+  if (ggla_widget_make_current(GGLA_WIDGET(widget))) {
 
     glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
     glarea_draw_scene();
-    gtk_gl_area_swap_buffers (GTK_GL_AREA(widget));
+    ggla_widget_swap_buffers (GGLA_WIDGET(widget));
 
   }
 
@@ -312,7 +312,7 @@ gboolean glarea_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data) {
 /* Function: glarea_reshape (GtkWidget*, GdkEventConfigure*)                 */
 /*                                                                           */
 /* This function performs the operations needed to maintain the viewing area */
-/* of the GtkGLArea. This should be called whenever the size of the area     */
+/* of the GglaWidget. This should be called whenever the size of the area     */
 /* is changed.                                                               */
 /*                                                                           */
 /*****************************************************************************/
@@ -324,7 +324,7 @@ gint glarea_reshape (GtkWidget* widget, GdkEventConfigure* event) {
   int w = allocation.width;
   int h = allocation.height;
 
-  if (gtk_gl_area_make_current (GTK_GL_AREA(widget))) {
+  if (ggla_widget_make_current (GGLA_WIDGET(widget))) {
 
     glViewport (0, 0, w, h);
     glMatrixMode (GL_PROJECTION);
@@ -342,14 +342,14 @@ gint glarea_reshape (GtkWidget* widget, GdkEventConfigure* event) {
 /*                                                                           */
 /* Function: glarea_init (GtkWidget*)                                        */
 /*                                                                           */
-/* This function is a callback for the realization of the GtkGLArea widtget. */
+/* This function is a callback for the realization of the GglaWidget widtget. */
 /* You should do any OpenGL initialization here.                             */
 /*                                                                           */
 /*****************************************************************************/
 
 gint glarea_init (GtkWidget* widget) {
 
-  if (gtk_gl_area_make_current (GTK_GL_AREA(widget))) {
+  if (ggla_widget_make_current (GGLA_WIDGET(widget))) {
 
     /* Procedural texture creation */
 
@@ -381,8 +381,8 @@ gint glarea_init (GtkWidget* widget) {
 /*                                                                           */
 /* Function: glarea_destroy (GtkWidget*)                                     */
 /*                                                                           */
-/* This function is a callback for the main GtkGLArea. It deletes should     */
-/* delete any data structures stored in the GtkGLArea.                       */
+/* This function is a callback for the main GglaWidget. It deletes should     */
+/* delete any data structures stored in the GglaWidget.                       */
 /*                                                                           */
 /*****************************************************************************/
 
@@ -402,7 +402,7 @@ gint glarea_destroy (GtkWidget* widget) {
 /* Function: main (int, char**)                                              */
 /*                                                                           */
 /* The main function sets up our GUI and calls the functions needed to       */
-/* create our GtkGLArea.                                                     */
+/* create our GglaWidget.                                                     */
 /*                                                                           */
 /*****************************************************************************/
 
@@ -441,7 +441,7 @@ int main (int argc, char** argv) {
 
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
-  gtk_window_set_title (GTK_WINDOW(window), "GtkGLArea Shader Demo");
+  gtk_window_set_title (GTK_WINDOW(window), "GglaWidget Shader Demo");
 
   g_signal_connect (G_OBJECT(window), "delete-event",
                     G_CALLBACK(gtk_main_quit), NULL);
diff --git a/examples/simple.c b/examples/simple.c
index ff08266..1802022 100644
--- a/examples/simple.c
+++ b/examples/simple.c
@@ -24,7 +24,7 @@
 gint init(GtkWidget *widget)
 {
   /* OpenGL functions can be called only if make_current returns true */
-  if (gtk_gl_area_make_current(GTK_GL_AREA(widget)))
+  if (ggla_widget_make_current(GGLA_WIDGET(widget)))
     {
       GtkAllocation allocation;
       gtk_widget_get_allocation (widget, &allocation);
@@ -43,7 +43,7 @@ gint init(GtkWidget *widget)
 gboolean draw (GtkWidget *widget, cairo_t *cr, gpointer data)
 {
   /* OpenGL functions can be called only if make_current returns true */
-  if (gtk_gl_area_make_current(GTK_GL_AREA(widget)))
+  if (ggla_widget_make_current(GGLA_WIDGET(widget)))
     {
 
       /* Draw simple triangle */
@@ -57,7 +57,7 @@ gboolean draw (GtkWidget *widget, cairo_t *cr, gpointer data)
       glEnd();
 
       /* Swap backbuffer to front */
-      gtk_gl_area_swap_buffers(GTK_GL_AREA(widget));
+      ggla_widget_swap_buffers(GGLA_WIDGET(widget));
 
     }
 
@@ -68,7 +68,7 @@ gboolean draw (GtkWidget *widget, cairo_t *cr, gpointer data)
 gint reshape(GtkWidget *widget, GdkEventConfigure *event)
 {
   /* OpenGL functions can be called only if make_current returns true */
-  if (gtk_gl_area_make_current(GTK_GL_AREA(widget)))
+  if (ggla_widget_make_current(GGLA_WIDGET(widget)))
     {
       GtkAllocation allocation;
       gtk_widget_get_allocation (widget, &allocation);
@@ -86,23 +86,23 @@ int main(int argc, char **argv)
   /* Attribute list for gtkglarea widget. Specifies a
      list of Boolean attributes and enum/integer
      attribute/value pairs. The last attribute must be
-     GDK_GL_NONE. See glXChooseVisual manpage for further
+     GGLA_NONE. See glXChooseVisual manpage for further
      explanation.
   */
   int attrlist[] = {
-    GDK_GL_RGBA,
-    GDK_GL_RED_SIZE,1,
-    GDK_GL_GREEN_SIZE,1,
-    GDK_GL_BLUE_SIZE,1,
-    GDK_GL_DOUBLEBUFFER,
-    GDK_GL_NONE
+    GGLA_RGBA,
+    GGLA_RED_SIZE,1,
+    GGLA_GREEN_SIZE,1,
+    GGLA_BLUE_SIZE,1,
+    GGLA_DOUBLEBUFFER,
+    GGLA_NONE
   };
 
   /* initialize gtk */
   gtk_init(&argc, &argv);
 
   /* Check if OpenGL is supported. */
-  if (gdk_gl_query() == FALSE) {
+  if (ggla_query() == FALSE) {
     g_print("OpenGL not supported\n");
     return 0;
   }
@@ -119,7 +119,7 @@ int main(int argc, char **argv)
 
 
   /* Create new OpenGL widget. */
-  glarea = GTK_WIDGET(gtk_gl_area_new(attrlist));
+  glarea = GTK_WIDGET(ggla_widget_new(attrlist));
   /* Events for widget must be set before X Window is created */
   gtk_widget_set_events(GTK_WIDGET(glarea),
                        GDK_EXPOSURE_MASK|
@@ -145,7 +145,7 @@ int main(int argc, char **argv)
   gtk_widget_show(GTK_WIDGET(window));
 
   /* vendor dependent version info string */
-  info_str = gdk_gl_get_info();
+  info_str = ggla_get_info();
   g_print(info_str);
   g_free(info_str);
 
diff --git a/examples/viewlw.c b/examples/viewlw.c
index 1da4d01..019fad0 100644
--- a/examples/viewlw.c
+++ b/examples/viewlw.c
@@ -97,11 +97,11 @@ gboolean glarea_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
 {
   GLfloat m[4][4];
 
-  GtkGLArea *glarea = GTK_GL_AREA(widget);
+  GglaWidget *glarea = GGLA_WIDGET(widget);
   mesh_info *info = (mesh_info*) g_object_get_data (G_OBJECT (widget), "mesh_info");
 
   /* OpenGL calls can be done only if make_current returns true */
-  if (gtk_gl_area_make_current(glarea)) {
+  if (ggla_widget_make_current(glarea)) {
     /* basic initialization */
     if (info->do_init == TRUE) {
       initgl();
@@ -126,7 +126,7 @@ gboolean glarea_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
     lw_object_show(info->lwobject);
 
     /* swap backbuffer to front */
-    gtk_gl_area_swap_buffers(glarea);
+    ggla_widget_swap_buffers(glarea);
   }
 
   return TRUE;
@@ -135,7 +135,7 @@ gboolean glarea_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
 gint glarea_configure(GtkWidget *widget, GdkEventConfigure *event)
 {
   /* OpenGL calls can be done only if make_current returns true */
-  if (gtk_gl_area_make_current(GTK_GL_AREA(widget))) {
+  if (ggla_widget_make_current(GGLA_WIDGET(widget))) {
       GtkAllocation allocation;
       gtk_widget_get_allocation (widget, &allocation);
       glViewport(0, 0, allocation.width, allocation.height);
@@ -298,17 +298,17 @@ gint show_lwobject(char const *lwobject_name)
 
 
   /* create new OpenGL widget */
-  glarea = gtk_gl_area_new_vargs(NULL, /* no sharing */
-                                GDK_GL_RGBA,
-                                GDK_GL_RED_SIZE,1,
-                                GDK_GL_GREEN_SIZE,1,
-                                GDK_GL_BLUE_SIZE,1,
-                                GDK_GL_DEPTH_SIZE,1,
-                                GDK_GL_DOUBLEBUFFER,
-                                GDK_GL_NONE);  /* last argument must be GDK_GL_NONE */
+  glarea = ggla_widget_new_vargs(NULL, /* no sharing */
+                                GGLA_RGBA,
+                                GGLA_RED_SIZE,1,
+                                GGLA_GREEN_SIZE,1,
+                                GGLA_BLUE_SIZE,1,
+                                GGLA_DEPTH_SIZE,1,
+                                GGLA_DOUBLEBUFFER,
+                                GGLA_NONE);  /* last argument must be GDK_GL_NONE */
   if (glarea == NULL) {
     lw_object_free(lwobject);
-    g_print("Can't create GtkGLArea widget\n");
+    g_print("Can't create GglaWidget widget\n");
     return FALSE;
   }
   /* set up events and signals for OpenGL widget */
@@ -412,7 +412,7 @@ int main (int argc, char **argv)
   gtk_init( &argc, &argv );
 
   /* Check if OpenGL is supported. */
-  if (gdk_gl_query() == FALSE) {
+  if (ggla_query() == FALSE) {
     g_print("OpenGL not supported\n");
     return 0;
   }
diff --git a/examples/zktor.c b/examples/zktor.c
index 8205d98..225dcd6 100644
--- a/examples/zktor.c
+++ b/examples/zktor.c
@@ -700,7 +700,7 @@ gint switch_fullscreen(GtkWidget *gl_area)
          if (gdk_pointer_grab(gl_area->window, FALSE, 0, NULL, NULL, GDK_CURRENT_TIME) == 0)
            {
              gtk_widget_grab_focus(gl_area);
-             if (gtk_gl_area_make_current(GTK_GL_AREA(gl_area)))
+             if (ggla_widget_make_current(GGLA_WIDGET(gl_area)))
                {
                  if (XMesaSetFXmode((XMESA_FX_FULLSCREEN)))
                    {
@@ -717,7 +717,7 @@ gint switch_fullscreen(GtkWidget *gl_area)
 
   if (fullscreenwidget == gl_area)
     {
-      if (gtk_gl_area_make_current(GTK_GL_AREA(gl_area)))
+      if (ggla_widget_make_current(GGLA_WIDGET(gl_area)))
        XMesaSetFXmode(XMESA_FX_WINDOW);
 
       gdk_keyboard_ungrab(GDK_CURRENT_TIME);
@@ -737,7 +737,7 @@ gint switch_fullscreen(GtkWidget *gl_area)
 gint init(GtkWidget *widget)
 {
   /* OpenGL functions can be called only if makecurrent returns true */
-  if (gtk_gl_area_make_current(GTK_GL_AREA(widget))) {
+  if (ggla_widget_make_current(GGLA_WIDGET(widget))) {
 
     /* set viewport */
     GtkAllocation allocation;
@@ -751,11 +751,11 @@ gint init(GtkWidget *widget)
 /* When widget is exposed it's contents are redrawn. */
 gboolean  draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
 {
-  if (gtk_gl_area_make_current(GTK_GL_AREA(widget)))
+  if (ggla_widget_make_current(GGLA_WIDGET(widget)))
     game_render();
 
   /* Swap backbuffer to front */
-  gtk_gl_area_swap_buffers(GTK_GL_AREA(widget));
+  ggla_widget_swap_buffers(GGLA_WIDGET(widget));
 
   return TRUE;
 }
@@ -764,7 +764,7 @@ gboolean  draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
 gint reshape(GtkWidget *widget, GdkEventConfigure *event)
 {
   /* OpenGL functions can be called only if make_current returns true */
-  if (gtk_gl_area_make_current(GTK_GL_AREA(widget)))
+  if (ggla_widget_make_current(GGLA_WIDGET(widget)))
     {
       GtkAllocation allocation;
       gtk_widget_get_allocation (widget, &allocation);
@@ -850,16 +850,16 @@ int main(int argc, char **argv)
   /* Attribute list for gtkglarea widget. Specifies a
      list of Boolean attributes and enum/integer
      attribute/value pairs. The last attribute must be
-     GDK_GL_NONE. See glXChooseVisual manpage for further
+     GGLA_NONE. See glXChooseVisual manpage for further
      explanation.
   */
   int attrlist[] = {
-    GDK_GL_RGBA,
-    GDK_GL_RED_SIZE,1,
-    GDK_GL_GREEN_SIZE,1,
-    GDK_GL_BLUE_SIZE,1,
-    GDK_GL_DOUBLEBUFFER,
-    GDK_GL_NONE
+    GGLA_RGBA,
+    GGLA_RED_SIZE,1,
+    GGLA_GREEN_SIZE,1,
+    GGLA_BLUE_SIZE,1,
+    GGLA_DOUBLEBUFFER,
+    GGLA_NONE
   };
 
 #ifdef FULLSCREEN_MESA_3DFX
@@ -871,7 +871,7 @@ int main(int argc, char **argv)
   gtk_init(&argc, &argv);
 
   /* Check if OpenGL (GLX extension) is supported. */
-  if (gdk_gl_query() == FALSE) {
+  if (ggla_query() == FALSE) {
     g_print("OpenGL not supported\n");
     return 0;
   }
@@ -893,7 +893,7 @@ int main(int argc, char **argv)
 
 
   /* Create new OpenGL widget. */
-  glarea = GTK_WIDGET(gtk_gl_area_new(attrlist));
+  glarea = GTK_WIDGET(ggla_widget_new(attrlist));
   /* Events for widget must be set before X Window is created */
   gtk_widget_set_events(GTK_WIDGET(glarea),
                        GDK_EXPOSURE_MASK|


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