| 1 |
/* GDK - The GIMP Drawing Kit |
| 2 |
* |
| 3 |
* gdkglcontext-quartz.h: Private Quartz specific OpenGL wrappers |
| 4 |
* |
| 5 |
* Copyright © 2014 Emmanuele Bassi |
| 6 |
* Copyright © 2014 Red Hat, Int |
| 7 |
* Copyright © 2014 Brion Vibber |
| 8 |
* |
| 9 |
* This library is free software; you can redistribute it and/or |
| 10 |
* modify it under the terms of the GNU Library General Public |
| 11 |
* License as published by the Free Software Foundation; either |
| 12 |
* version 2 of the License, or (at your option) any later version. |
| 13 |
* |
| 14 |
* This library is distributed in the hope that it will be useful, |
| 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 |
* Library General Public License for more details. |
| 18 |
* |
| 19 |
* You should have received a copy of the GNU Library General Public |
| 20 |
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 21 |
*/ |
| 22 |
|
| 23 |
#ifndef __GDK_QUARTZ_GL_CONTEXT__ |
| 24 |
#define __GDK_QUARTZ_GL_CONTEXT__ |
| 25 |
|
| 26 |
#include "gdkglcontextprivate.h" |
| 27 |
#include "gdkdisplayprivate.h" |
| 28 |
#include "gdkvisual.h" |
| 29 |
#include "gdkwindow.h" |
| 30 |
#include "gdkinternals.h" |
| 31 |
#include "gdkmain.h" |
| 32 |
|
| 33 |
#import <OpenGL/OpenGL.h> |
| 34 |
#import <OpenGL/gl.h> |
| 35 |
#import <AppKit/AppKit.h> |
| 36 |
|
| 37 |
G_BEGIN_DECLS |
| 38 |
|
| 39 |
struct _GdkQuartzGLContext |
| 40 |
{ |
| 41 |
GdkGLContext parent_instance; |
| 42 |
|
| 43 |
NSOpenGLContext *gl_context; |
| 44 |
gboolean is_attached; |
| 45 |
}; |
| 46 |
|
| 47 |
struct _GdkQuartzGLContextClass |
| 48 |
{ |
| 49 |
GdkGLContextClass parent_class; |
| 50 |
}; |
| 51 |
|
| 52 |
gboolean gdk_quartz_display_init_gl (GdkDisplay *display); |
| 53 |
GdkGLContext * gdk_quartz_window_create_gl_context (GdkWindow *window, |
| 54 |
gboolean attach, |
| 55 |
GdkGLContext *share, |
| 56 |
GError **error); |
| 57 |
void gdk_quartz_window_invalidate_for_new_frame (GdkWindow *window, |
| 58 |
cairo_region_t *update_area); |
| 59 |
gboolean gdk_quartz_display_is_gl_context_current (GdkDisplay *display, |
| 60 |
GdkGLContext *context); |
| 61 |
gboolean gdk_quartz_display_make_gl_context_current (GdkDisplay *display, |
| 62 |
GdkGLContext *context); |
| 63 |
|
| 64 |
G_END_DECLS |
| 65 |
|
| 66 |
#endif /* __GDK_QUARTZ_GL_CONTEXT__ */ |