| 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 <X11/X.h> |
| 25 |
#include <X11/Xlib.h> |
| 26 |
|
| 27 |
#include <epoxy/gl.h> |
| 28 |
#include <epoxy/glx.h> |
| 29 |
|
| 30 |
#include "gdkglcontextprivate.h" |
| 31 |
#include "gdkdisplayprivate.h" |
| 32 |
#include "gdkvisual.h" |
| 33 |
#include "gdkwindow.h" |
| 34 |
#include "gdkinternals.h" |
| 35 |
#include "gdkmain.h" |
| 36 |
|
| 37 |
G_BEGIN_DECLS |
| 38 |
|
| 39 |
struct _GdkX11GLContext |
| 40 |
{ |
| 41 |
GdkGLContext parent_instance; |
| 42 |
|
| 43 |
GLXContext glx_context; |
| 44 |
GLXFBConfig glx_config; |
| 45 |
GLXDrawable drawable; |
| 46 |
|
| 47 |
guint is_attached : 1; |
| 48 |
guint is_direct : 1; |
| 49 |
guint do_frame_sync : 1; |
| 50 |
|
| 51 |
guint do_blit_swap : 1; |
| 52 |
}; |
| 53 |
|
| 54 |
struct _GdkX11GLContextClass |
| 55 |
{ |
| 56 |
GdkGLContextClass parent_class; |
| 57 |
}; |
| 58 |
|
| 59 |
gboolean gdk_x11_screen_init_gl (GdkScreen *screen); |
| 60 |
GdkGLContext * gdk_x11_window_create_gl_context (GdkWindow *window, |
| 61 |
gboolean attached, |
| 62 |
GdkGLContext *share, |
| 63 |
GError **error); |
| 64 |
void gdk_x11_window_invalidate_for_new_frame (GdkWindow *window, |
| 65 |
cairo_region_t *update_area); |
| 66 |
gboolean gdk_x11_display_is_gl_context_current (GdkDisplay *display, |
| 67 |
GdkGLContext *context); |
| 68 |
gboolean gdk_x11_display_make_gl_context_current (GdkDisplay *display, |
| 69 |
GdkGLContext *context); |
| 70 |
|
| 71 |
G_END_DECLS |
| 72 |
|
| 73 |
#endif /* __GDK_X11_GL_CONTEXT__ */ |