1/* GDK - The GIMP Drawing Kit
2 *
3 * gdkglcontext-x11.h: Private X11 specific OpenGL wrappers
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_X11_GL_CONTEXT__
22#define __GDK_X11_GL_CONTEXT__
23
24#include "gdkx11glcontext.h"
25
26#include <X11/X.h>
27#include <X11/Xlib.h>
28
29#ifdef HAVE_XDAMAGE
30#include <X11/extensions/Xdamage.h>
31#endif
32
33#include <epoxy/gl.h>
34#include <epoxy/glx.h>
35
36#include "gdkglcontextprivate.h"
37#include "gdkdisplay-x11.h"
38#include "gdksurface.h"
39
40G_BEGIN_DECLS
41
42#define GDK_X11_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_X11_GL_CONTEXT, GdkX11GLContextClass))
43#define GDK_X11_GL_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_X11_GL_CONTEXT, GdkX11GLContextClass))
44#define GDK_X11_IS_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_X11_GL_CONTEXT))
45
46struct _GdkX11GLContext
47{
48 GdkGLContext parent_instance;
49};
50
51struct _GdkX11GLContextClass
52{
53 GdkGLContextClass parent_class;
54};
55
56/* GLX */
57#define GDK_TYPE_X11_GL_CONTEXT_GLX (gdk_x11_gl_context_glx_get_type())
58#define GDK_X11_GL_CONTEXT_GLX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_X11_GL_CONTEXT_GLX, GdkX11GLContextGLX))
59#define GDK_IS_X11_GL_CONTEXT_GLX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_X11_GL_CONTEXT_GLX))
60
61typedef struct _GdkX11GLContextGLX GdkX11GLContextGLX;
62
63gboolean gdk_x11_display_init_glx (GdkX11Display *display_x11,
64 Visual **out_visual,
65 int *out_depth,
66 GError **error);
67void gdk_x11_surface_destroy_glx_drawable (GdkX11Surface *self);
68
69GType gdk_x11_gl_context_glx_get_type (void) G_GNUC_CONST;
70
71
72/* EGL */
73#define GDK_TYPE_X11_GL_CONTEXT_EGL (gdk_x11_gl_context_egl_get_type())
74#define GDK_X11_GL_CONTEXT_EGL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_X11_GL_CONTEXT_EGL, GdkX11GLContextEGL))
75#define GDK_IS_X11_GL_CONTEXT_EGL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_X11_GL_CONTEXT_EGL))
76
77typedef struct _GdkX11GLContextEGL GdkX11GLContextEGL;
78
79GType gdk_x11_gl_context_egl_get_type (void) G_GNUC_CONST;
80
81G_END_DECLS
82
83#endif /* __GDK_X11_GL_CONTEXT__ */
84

source code of gtk/gdk/x11/gdkglcontext-x11.h