[gtk+] quartz: Non-implementation of GdkGLContext



commit 0c4deb656e6fe161a6c4cfdedbd2599e31b879d0
Author: Philip Chimento <philip chimento gmail com>
Date:   Wed Apr 8 23:31:51 2015 -0700

    quartz: Non-implementation of GdkGLContext
    
    This makes sure the Quartz backend returns an error when asked to create
    a GL context, rather than crashing because of a NULL vfunc.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=740199

 gdk/quartz/Makefile.am           |    2 +
 gdk/quartz/gdkglcontext-quartz.c |   39 ++++++++++++++++++++++++++++++++++++
 gdk/quartz/gdkglcontext-quartz.h |   41 ++++++++++++++++++++++++++++++++++++++
 gdk/quartz/gdkwindow-quartz.c    |    2 +
 4 files changed, 84 insertions(+), 0 deletions(-)
---
diff --git a/gdk/quartz/Makefile.am b/gdk/quartz/Makefile.am
index 2c8fb90..8954849 100644
--- a/gdk/quartz/Makefile.am
+++ b/gdk/quartz/Makefile.am
@@ -33,6 +33,8 @@ libgdk_quartz_la_SOURCES =            \
        gdkdnd-quartz.h         \
        gdkevents-quartz.c      \
        gdkeventloop-quartz.c   \
+       gdkglcontext-quartz.c   \
+       gdkglcontext-quartz.h   \
        gdkglobals-quartz.c     \
        gdkkeys-quartz.c        \
        gdkprivate-quartz.h     \
diff --git a/gdk/quartz/gdkglcontext-quartz.c b/gdk/quartz/gdkglcontext-quartz.c
new file mode 100644
index 0000000..a6cc3b6
--- /dev/null
+++ b/gdk/quartz/gdkglcontext-quartz.c
@@ -0,0 +1,39 @@
+/* GDK - The GIMP Drawing Kit
+ *
+ * gdkglcontext-quartz.c: Quartz specific OpenGL wrappers
+ *
+ * Copyright © 2014  Emmanuele Bassi
+ * Copyright © 2014  Alexander Larsson
+ * Copyright © 2014  Brion Vibber
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include "gdkglcontext-quartz.h"
+
+#include "gdkintl.h"
+
+GdkGLContext *
+gdk_quartz_window_create_gl_context (GdkWindow     *window,
+                                     gboolean       attached,
+                                     GdkGLContext  *share,
+                                     GError       **error)
+{
+  /* FIXME: implement */
+  g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
+                       _("Not implemented on OS X"));
+  return NULL;
+}
diff --git a/gdk/quartz/gdkglcontext-quartz.h b/gdk/quartz/gdkglcontext-quartz.h
new file mode 100644
index 0000000..bc55a57
--- /dev/null
+++ b/gdk/quartz/gdkglcontext-quartz.h
@@ -0,0 +1,41 @@
+/* GDK - The GIMP Drawing Kit
+ *
+ * gdkglcontext-quartz.h: Private Quartz specific OpenGL wrappers
+ *
+ * Copyright © 2014  Emmanuele Bassi
+ * Copyright © 2014  Red Hat, Int
+ * Copyright © 2014  Brion Vibber
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GDK_QUARTZ_GL_CONTEXT__
+#define __GDK_QUARTZ_GL_CONTEXT__
+
+#include "gdkglcontextprivate.h"
+#include "gdkvisual.h"
+#include "gdkwindow.h"
+#include "gdkinternals.h"
+#include "gdkmain.h"
+
+G_BEGIN_DECLS
+
+GdkGLContext *  gdk_quartz_window_create_gl_context                (GdkWindow         *window,
+                                                                    gboolean           attach,
+                                                                    GdkGLContext      *share,
+                                                                    GError           **error);
+
+G_END_DECLS
+
+#endif /* __GDK_QUARTZ_GL_CONTEXT__ */
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 6306034..b77be34 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -25,6 +25,7 @@
 
 #include "gdkwindowimpl.h"
 #include "gdkprivate-quartz.h"
+#include "gdkglcontext-quartz.h"
 #include "gdkquartzscreen.h"
 #include "gdkquartzcursor.h"
 
@@ -2944,6 +2945,7 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
   impl_class->change_property = _gdk_quartz_window_change_property;
   impl_class->delete_property = _gdk_quartz_window_delete_property;
 
+  impl_class->create_gl_context = gdk_quartz_window_create_gl_context;
 
   impl_quartz_class->get_context = gdk_window_impl_quartz_get_context;
   impl_quartz_class->release_context = gdk_window_impl_quartz_release_context;


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