| 1 | /* GDK - The GIMP Drawing Kit |
| 2 | * |
| 3 | * gdkglcontext.h: GL context abstraction |
| 4 | * |
| 5 | * Copyright © 2014 Emmanuele Bassi |
| 6 | * |
| 7 | * This library is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Library General Public |
| 9 | * License as published by the Free Software Foundation; either |
| 10 | * version 2 of the License, or (at your option) any later version. |
| 11 | * |
| 12 | * This library is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * Library General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Library General Public |
| 18 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | #ifndef __GDK_GL_CONTEXT_H__ |
| 22 | #define __GDK_GL_CONTEXT_H__ |
| 23 | |
| 24 | #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) |
| 25 | #error "Only <gdk/gdk.h> can be included directly." |
| 26 | #endif |
| 27 | |
| 28 | #include <gdk/gdkversionmacros.h> |
| 29 | #include <gdk/gdktypes.h> |
| 30 | |
| 31 | G_BEGIN_DECLS |
| 32 | |
| 33 | #define GDK_TYPE_GL_CONTEXT (gdk_gl_context_get_type ()) |
| 34 | #define GDK_GL_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_GL_CONTEXT, GdkGLContext)) |
| 35 | #define GDK_IS_GL_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_GL_CONTEXT)) |
| 36 | |
| 37 | #define GDK_GL_ERROR (gdk_gl_error_quark ()) |
| 38 | |
| 39 | GDK_AVAILABLE_IN_3_16 |
| 40 | GQuark gdk_gl_error_quark (void); |
| 41 | |
| 42 | GDK_AVAILABLE_IN_3_16 |
| 43 | GType gdk_gl_context_get_type (void) G_GNUC_CONST; |
| 44 | |
| 45 | GDK_AVAILABLE_IN_3_16 |
| 46 | GdkDisplay * gdk_gl_context_get_display (GdkGLContext *context); |
| 47 | GDK_AVAILABLE_IN_3_16 |
| 48 | GdkWindow * gdk_gl_context_get_window (GdkGLContext *context); |
| 49 | GDK_AVAILABLE_IN_3_16 |
| 50 | GdkGLContext * gdk_gl_context_get_shared_context (GdkGLContext *context); |
| 51 | GDK_AVAILABLE_IN_3_16 |
| 52 | void gdk_gl_context_get_version (GdkGLContext *context, |
| 53 | int *major, |
| 54 | int *minor); |
| 55 | GDK_AVAILABLE_IN_3_20 |
| 56 | gboolean gdk_gl_context_is_legacy (GdkGLContext *context); |
| 57 | |
| 58 | GDK_AVAILABLE_IN_3_16 |
| 59 | void gdk_gl_context_set_required_version (GdkGLContext *context, |
| 60 | int major, |
| 61 | int minor); |
| 62 | GDK_AVAILABLE_IN_3_16 |
| 63 | void gdk_gl_context_get_required_version (GdkGLContext *context, |
| 64 | int *major, |
| 65 | int *minor); |
| 66 | GDK_AVAILABLE_IN_3_16 |
| 67 | void gdk_gl_context_set_debug_enabled (GdkGLContext *context, |
| 68 | gboolean enabled); |
| 69 | GDK_AVAILABLE_IN_3_16 |
| 70 | gboolean gdk_gl_context_get_debug_enabled (GdkGLContext *context); |
| 71 | GDK_AVAILABLE_IN_3_16 |
| 72 | void gdk_gl_context_set_forward_compatible (GdkGLContext *context, |
| 73 | gboolean compatible); |
| 74 | GDK_AVAILABLE_IN_3_16 |
| 75 | gboolean gdk_gl_context_get_forward_compatible (GdkGLContext *context); |
| 76 | GDK_AVAILABLE_IN_3_22 |
| 77 | void gdk_gl_context_set_use_es (GdkGLContext *context, |
| 78 | int use_es); |
| 79 | GDK_AVAILABLE_IN_3_22 |
| 80 | gboolean gdk_gl_context_get_use_es (GdkGLContext *context); |
| 81 | |
| 82 | GDK_AVAILABLE_IN_3_16 |
| 83 | gboolean gdk_gl_context_realize (GdkGLContext *context, |
| 84 | GError **error); |
| 85 | GDK_AVAILABLE_IN_3_16 |
| 86 | void gdk_gl_context_make_current (GdkGLContext *context); |
| 87 | GDK_AVAILABLE_IN_3_16 |
| 88 | GdkGLContext * gdk_gl_context_get_current (void); |
| 89 | GDK_AVAILABLE_IN_3_16 |
| 90 | void gdk_gl_context_clear_current (void); |
| 91 | |
| 92 | G_END_DECLS |
| 93 | |
| 94 | #endif /* __GDK_GL_CONTEXT_H__ */ |
| 95 | |