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
31G_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
39GDK_AVAILABLE_IN_3_16
40GQuark gdk_gl_error_quark (void);
41
42GDK_AVAILABLE_IN_3_16
43GType gdk_gl_context_get_type (void) G_GNUC_CONST;
44
45GDK_AVAILABLE_IN_3_16
46GdkDisplay * gdk_gl_context_get_display (GdkGLContext *context);
47GDK_AVAILABLE_IN_3_16
48GdkWindow * gdk_gl_context_get_window (GdkGLContext *context);
49GDK_AVAILABLE_IN_3_16
50GdkGLContext * gdk_gl_context_get_shared_context (GdkGLContext *context);
51GDK_AVAILABLE_IN_3_16
52void gdk_gl_context_get_version (GdkGLContext *context,
53 int *major,
54 int *minor);
55GDK_AVAILABLE_IN_3_20
56gboolean gdk_gl_context_is_legacy (GdkGLContext *context);
57
58GDK_AVAILABLE_IN_3_16
59void gdk_gl_context_set_required_version (GdkGLContext *context,
60 int major,
61 int minor);
62GDK_AVAILABLE_IN_3_16
63void gdk_gl_context_get_required_version (GdkGLContext *context,
64 int *major,
65 int *minor);
66GDK_AVAILABLE_IN_3_16
67void gdk_gl_context_set_debug_enabled (GdkGLContext *context,
68 gboolean enabled);
69GDK_AVAILABLE_IN_3_16
70gboolean gdk_gl_context_get_debug_enabled (GdkGLContext *context);
71GDK_AVAILABLE_IN_3_16
72void gdk_gl_context_set_forward_compatible (GdkGLContext *context,
73 gboolean compatible);
74GDK_AVAILABLE_IN_3_16
75gboolean gdk_gl_context_get_forward_compatible (GdkGLContext *context);
76GDK_AVAILABLE_IN_3_22
77void gdk_gl_context_set_use_es (GdkGLContext *context,
78 int use_es);
79GDK_AVAILABLE_IN_3_22
80gboolean gdk_gl_context_get_use_es (GdkGLContext *context);
81
82GDK_AVAILABLE_IN_3_16
83gboolean gdk_gl_context_realize (GdkGLContext *context,
84 GError **error);
85GDK_AVAILABLE_IN_3_16
86void gdk_gl_context_make_current (GdkGLContext *context);
87GDK_AVAILABLE_IN_3_16
88GdkGLContext * gdk_gl_context_get_current (void);
89GDK_AVAILABLE_IN_3_16
90void gdk_gl_context_clear_current (void);
91
92G_END_DECLS
93
94#endif /* __GDK_GL_CONTEXT_H__ */
95