summaryrefslogtreecommitdiffstats
path: root/recipes/opengldummy/files/headers/EGL/eglplatform.h
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@theqtcompany.com>2014-11-20 10:14:20 +0200
committerAndy Nichols <andy.nichols@theqtcompany.com>2014-11-20 11:22:37 +0200
commit21bad4d54bea4d7c0891829c7de56bd24e2afca8 (patch)
tree30f1fde989173b8327e5f15b9e91404b19b6d0cf /recipes/opengldummy/files/headers/EGL/eglplatform.h
parentd93b061d7592637edb6c20da7f4d5f1ee7a9f12d (diff)
downloadmeta-boot2qt-21bad4d54bea4d7c0891829c7de56bd24e2afca8.tar.gz
Common dummy OpenGL implementation
Use common sources and headers to provide both dummy OpenGL libs and QtGlesStream lib. Change-Id: Ia71c3ffd7b1f45bf5eea5ac78027c8439855aac5 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Diffstat (limited to 'recipes/opengldummy/files/headers/EGL/eglplatform.h')
-rw-r--r--recipes/opengldummy/files/headers/EGL/eglplatform.h143
1 files changed, 143 insertions, 0 deletions
diff --git a/recipes/opengldummy/files/headers/EGL/eglplatform.h b/recipes/opengldummy/files/headers/EGL/eglplatform.h
new file mode 100644
index 0000000..bcbda98
--- /dev/null
+++ b/recipes/opengldummy/files/headers/EGL/eglplatform.h
@@ -0,0 +1,143 @@
1#ifndef __eglplatform_h_
2#define __eglplatform_h_
3
4/*
5** Copyright (c) 2007-2013 The Khronos Group Inc.
6**
7** Permission is hereby granted, free of charge, to any person obtaining a
8** copy of this software and/or associated documentation files (the
9** "Materials"), to deal in the Materials without restriction, including
10** without limitation the rights to use, copy, modify, merge, publish,
11** distribute, sublicense, and/or sell copies of the Materials, and to
12** permit persons to whom the Materials are furnished to do so, subject to
13** the following conditions:
14**
15** The above copyright notice and this permission notice shall be included
16** in all copies or substantial portions of the Materials.
17**
18** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
25*/
26
27/* Platform-specific types and definitions for egl.h
28 * $Revision: 23432 $ on $Date: 2013-10-09 00:57:24 -0700 (Wed, 09 Oct 2013) $
29 *
30 * Adopters may modify khrplatform.h and this file to suit their platform.
31 * You are encouraged to submit all modifications to the Khronos group so that
32 * they can be included in future versions of this file. Please submit changes
33 * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
34 * by filing a bug against product "EGL" component "Registry".
35 */
36
37#include <KHR/khrplatform.h>
38
39/* Macros used in EGL function prototype declarations.
40 *
41 * EGL functions should be prototyped as:
42 *
43 * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
44 * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
45 *
46 * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
47 */
48
49#ifndef EGLAPI
50#define EGLAPI KHRONOS_APICALL
51#endif
52
53#ifndef EGLAPIENTRY
54#define EGLAPIENTRY KHRONOS_APIENTRY
55#endif
56#define EGLAPIENTRYP EGLAPIENTRY*
57
58/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
59 * are aliases of window-system-dependent types, such as X Display * or
60 * Windows Device Context. They must be defined in platform-specific
61 * code below. The EGL-prefixed versions of Native*Type are the same
62 * types, renamed in EGL 1.3 so all types in the API start with "EGL".
63 *
64 * Khronos STRONGLY RECOMMENDS that you use the default definitions
65 * provided below, since these changes affect both binary and source
66 * portability of applications using EGL running on different EGL
67 * implementations.
68 */
69
70#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
71
72#if 1
73/* QtGlesStream */
74typedef unsigned int EGLNativeDisplayType;
75typedef unsigned int EGLNativeWindowType;
76typedef unsigned int EGLNativePixmapType;
77#else
78#ifndef WIN32_LEAN_AND_MEAN
79#define WIN32_LEAN_AND_MEAN 1
80#endif
81#include <windows.h>
82
83typedef HDC EGLNativeDisplayType;
84typedef HBITMAP EGLNativePixmapType;
85typedef HWND EGLNativeWindowType;
86#endif
87
88#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
89
90typedef int EGLNativeDisplayType;
91typedef void *EGLNativeWindowType;
92typedef void *EGLNativePixmapType;
93
94#elif defined(__ANDROID__) || defined(ANDROID)
95
96#include <android/native_window.h>
97
98struct egl_native_pixmap_t;
99
100typedef struct ANativeWindow* EGLNativeWindowType;
101typedef struct egl_native_pixmap_t* EGLNativePixmapType;
102typedef void* EGLNativeDisplayType;
103
104#elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
105#if 1
106
107/* QtGlesStream */
108typedef unsigned int EGLNativeDisplayType;
109typedef unsigned int EGLNativeWindowType;
110typedef unsigned int EGLNativePixmapType;
111
112#else
113
114/* X11 (tentative) */
115#include <X11/Xlib.h>
116#include <X11/Xutil.h>
117
118typedef Display *EGLNativeDisplayType;
119typedef Pixmap EGLNativePixmapType;
120typedef Window EGLNativeWindowType;
121
122#endif
123
124#else
125#error "Platform not recognized"
126#endif
127
128/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
129typedef EGLNativeDisplayType NativeDisplayType;
130typedef EGLNativePixmapType NativePixmapType;
131typedef EGLNativeWindowType NativeWindowType;
132
133
134/* Define EGLint. This must be a signed integral type large enough to contain
135 * all legal attribute names and values passed into and out of EGL, whether
136 * their type is boolean, bitmask, enumerant (symbolic constant), integer,
137 * handle, or other. While in general a 32-bit integer will suffice, if
138 * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
139 * integer type.
140 */
141typedef khronos_int32_t EGLint;
142
143#endif /* __eglplatform_h */