+#elif defined(SYS_MAC)
+#include <gdk/gdkquartz.h>
+gpointer setup(GtkWidget *widget)
+{
+ /* Create context */
+ NSOpenGLPixelFormatAttribute attribs[] = {
+ NSOpenGLPFAColorSize, 24,
+ NSOpenGLPFAAlphaSize, 8,
+ NSOpenGLPFADepthSize, 1,
+ NSOpenGLPFADoubleBuffer,
+ 0
+ };
+ NSOpenGLPixelFormat *pix = [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs];
+ NSOpenGLContext *ctx = [[NSOpenGLContext alloc] initWithFormat:pix shareContext:nil];
+
+ /* Disable GTK double buffering */
+ gtk_widget_set_double_buffered(widget, FALSE);
+
+ return ctx;
+}
+gboolean configure(GtkWidget *widget, GdkEventConfigure *event, NSOpenGLContext *ctx)