Debian Codegraph @

gdk/win32/gdkglcontext-win32.h

raw
1 /* GDK - The GIMP Drawing Kit
2 *
3 * gdkglcontext-win32.h: Private Win32 specific OpenGL wrappers
4 *
5 * Copyright © 2014 Chun-wei Fan
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_WIN32_GL_CONTEXT__
22 #define __GDK_WIN32_GL_CONTEXT__
23
24 #ifdef DONT_INCLUDE_LIBEPOXY
25 # define WIN32_LEAN_AND_MEAN
26 # include <windows.h>
27 # include <GL/gl.h>
28
29 # include <glib.h>
30 #else
31 # include <epoxy/gl.h>
32 # include <epoxy/wgl.h>
33
34 # ifdef GDK_WIN32_ENABLE_EGL
35 # include <epoxy/egl.h>
36 # endif
37
38 # include "gdkglcontextprivate.h"
39 # include "gdkdisplayprivate.h"
40 # include "gdkvisual.h"
41 # include "gdkwindow.h"
42 #endif
43
44 G_BEGIN_DECLS
45
46 #ifndef DONT_INCLUDE_LIBEPOXY
47 void
48 gdk_win32_window_invalidate_egl_framebuffer (GdkWindow *window);
49
50 GdkGLContext *
51 gdk_win32_window_create_gl_context (GdkWindow *window,
52 gboolean attached,
53 GdkGLContext *share,
54 GError **error);
55
56 void
57 gdk_win32_window_invalidate_for_new_frame (GdkWindow *window,
58 cairo_region_t *update_area);
59
60 gboolean
61 gdk_win32_display_is_gl_context_current (GdkDisplay *display,
62 GdkGLContext *context);
63
64 gboolean
65 gdk_win32_display_is_wgl_context_current (GdkDisplay *display,
66 GdkGLContext *context);
67
68 #ifdef GDK_WIN32_ENABLE_EGL
69 gboolean
70 gdk_win32_display_is_egl_context_current (GdkDisplay *display,
71 GdkGLContext *context);
72 #else
73 #define gdk_win32_display_is_egl_context_current(disp,ctx) FALSE
74 #endif
75
76 gboolean
77 gdk_win32_display_make_gl_context_current (GdkDisplay *display,
78 GdkGLContext *context);
79
80 #endif /* !DONT_INCLUDE_LIBEPOXY */
81
82 HGLRC gdk_win32_private_wglGetCurrentContext (void);
83 BOOL gdk_win32_private_wglMakeCurrent (HDC hdc,
84 HGLRC hglrc);
85 void gdk_win32_private_wglDeleteContext (HGLRC hglrc);
86
87
88 G_END_DECLS
89
90 #endif /* __GDK_WIN32_GL_CONTEXT__ */