[gtk+] glarea: Make the code snippet compile



commit d027e365d3a94abd3f2685d98926e1e3546704af
Author: Timm Bäder <mail baedert org>
Date:   Wed Oct 11 13:26:59 2017 +0200

    glarea: Make the code snippet compile

 gtk/gtkglarea.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c
index c313518..5cbbe5e 100644
--- a/gtk/gtkglarea.c
+++ b/gtk/gtkglarea.c
@@ -56,11 +56,7 @@
  * create a widget instance and connect to the #GtkGLArea::render signal:
  *
  * |[<!-- language="C" -->
- *   // create a GtkGLArea instance
- *   GtkWidget *gl_area = gtk_gl_area_new ();
- *
- *   // connect to the "render" signal
- *   g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL);
+
  * ]|
  *
  * The `render()` function will be called when the #GtkGLArea is ready
@@ -80,13 +76,22 @@
  *     glClear (GL_COLOR_BUFFER_BIT);
  *
  *     // draw your object
- *     draw_an_object ();
+ *     // draw_an_object ();
  *
  *     // we completed our drawing; the draw commands will be
  *     // flushed at the end of the signal emission chain, and
  *     // the buffers will be drawn on the window
  *     return TRUE;
  *   }
+ *
+ *   void setup_glarea (void)
+ *   {
+ *     // create a GtkGLArea instance
+ *     GtkWidget *gl_area = gtk_gl_area_new ();
+ *
+ *     // connect to the "render" signal
+ *     g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL);
+ *   }
  * ]|
  *
  * If you need to initialize OpenGL state, e.g. buffer objects or


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