Debian Codegraph @

gdk/win32/gdkglcontext-win32.h

raw symbols SCIP
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 #pragma once
22
23 #ifndef DONT_INCLUDE_LIBEPOXY
24 #ifdef GDK_WINDOWING_WIN32
25 /* epoxy needs this, see https://github.com/anholt/libepoxy/issues/299 */
26 #include <windows.h>
27 #endif
28 #include <epoxy/gl.h>
29 #include <epoxy/wgl.h>
30
31 #ifdef HAVE_EGL
32 # include <epoxy/egl.h>
33 #endif
34
35 #include "gdkglcontextprivate.h"
36 #include "gdkdisplayprivate.h"
37 #include "gdksurface.h"
38 #else
39 # define WIN32_LEAN_AND_MEAN
40 # include <windows.h>
41 # include <GL/gl.h>
42
43 # include <glib.h>
44 #endif
45
46 G_BEGIN_DECLS
47
48 #ifndef DONT_INCLUDE_LIBEPOXY
49
50 #define GDK_WIN32_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WIN32_GL_CONTEXT, GdkWin32GLContextClass))
51 #define GDK_WIN32_GL_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WIN32_GL_CONTEXT, GdkWin32GLContextClass))
52 #define GDK_WIN32_IS_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WIN32_GL_CONTEXT))
53
54 struct _GdkWin32GLContext
55 {
56 GdkGLContext parent_instance;
57
58 HWND handle;
59 };
60
61 struct _GdkWin32GLContextClass
62 {
63 GdkGLContextClass parent_class;
64 };
65
66 ATOM gdk_win32_gl_context_get_class (void);
67
68 /* WGL */
69 #define GDK_TYPE_WIN32_GL_CONTEXT_WGL (gdk_win32_gl_context_wgl_get_type())
70 #define GDK_WIN32_GL_CONTEXT_WGL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_WIN32_GL_CONTEXT_WGL, GdkWin32GLContextWGL))
71 #define GDK_IS_WIN32_GL_CONTEXT_WGL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_WIN32_GL_CONTEXT_WGL))
72
73 typedef struct _GdkWin32GLContextWGL GdkWin32GLContextWGL;
74
75 GdkGLContext * gdk_win32_display_init_wgl (GdkDisplay *display,
76 GError **error);
77
78 GType gdk_win32_gl_context_wgl_get_type (void) G_GNUC_CONST;
79
80 /* EGL */
81 #define GDK_TYPE_WIN32_GL_CONTEXT_EGL (gdk_win32_gl_context_egl_get_type())
82 #define GDK_WIN32_GL_CONTEXT_EGL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_WIN32_GL_CONTEXT_EGL, GdkWin32GLContextEGL))
83 #define GDK_IS_WIN32_GL_CONTEXT_EGL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_WIN32_GL_CONTEXT_EGL))
84
85 typedef struct _GdkWin32GLContextEGL GdkWin32GLContextEGL;
86
87 GType gdk_win32_gl_context_egl_get_type (void) G_GNUC_CONST;
88
89 #endif /* !DONT_INCLUDE_LIBEPOXY */
90
91 HGLRC gdk_win32_private_wglGetCurrentContext (void);
92 BOOL gdk_win32_private_wglMakeCurrent (HDC hdc,
93 HGLRC hglrc);
94 void gdk_win32_private_wglDeleteContext (HGLRC hglrc);
95
96 G_END_DECLS
97