OLD | NEW |
1 #ifndef __eglplatform_h_ | 1 #ifndef __eglplatform_h_ |
2 #define __eglplatform_h_ | 2 #define __eglplatform_h_ |
3 | 3 |
4 /* | 4 /* |
5 ** Copyright (c) 2007-2009 The Khronos Group Inc. | 5 ** Copyright (c) 2007-2009 The Khronos Group Inc. |
6 ** | 6 ** |
7 ** Permission is hereby granted, free of charge, to any person obtaining a | 7 ** Permission is hereby granted, free of charge, to any person obtaining a |
8 ** copy of this software and/or associated documentation files (the | 8 ** copy of this software and/or associated documentation files (the |
9 ** "Materials"), to deal in the Materials without restriction, including | 9 ** "Materials"), to deal in the Materials without restriction, including |
10 ** without limitation the rights to use, copy, modify, merge, publish, | 10 ** without limitation the rights to use, copy, modify, merge, publish, |
11 ** distribute, sublicense, and/or sell copies of the Materials, and to | 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 | 12 ** permit persons to whom the Materials are furnished to do so, subject to |
13 ** the following conditions: | 13 ** the following conditions: |
14 ** | 14 ** |
15 ** The above copyright notice and this permission notice shall be included | 15 ** The above copyright notice and this permission notice shall be included |
16 ** in all copies or substantial portions of the Materials. | 16 ** in all copies or substantial portions of the Materials. |
17 ** | 17 ** |
18 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | 18 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
19 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | 19 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
20 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | 20 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
21 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | 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, | 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 | 23 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
24 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. | 24 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
25 */ | 25 */ |
26 | 26 |
27 /* Platform-specific types and definitions for egl.h | 27 /* Platform-specific types and definitions for egl.h |
28 * $Revision: 9724 $ on $Date: 2009-12-02 02:05:33 -0800 (Wed, 02 Dec 2009) $ | 28 * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $ |
29 * | 29 * |
30 * Adopters may modify khrplatform.h and this file to suit their platform. | 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 | 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 | 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) | 33 * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) |
34 * by filing a bug against product "EGL" component "Registry". | 34 * by filing a bug against product "EGL" component "Registry". |
35 */ | 35 */ |
36 | 36 |
37 #include <KHR/khrplatform.h> | 37 #include <KHR/khrplatform.h> |
38 | 38 |
39 /* Macros used in EGL function prototype declarations. | 39 /* Macros used in EGL function prototype declarations. |
40 * | 40 * |
41 * EGL functions should be prototyped as: | 41 * EGL functions should be prototyped as: |
42 * | 42 * |
43 * EGLAPI return-type EGLAPIENTRY eglFunction(arguments); | 43 * EGLAPI return-type EGLAPIENTRY eglFunction(arguments); |
44 * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); | 44 * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); |
45 * | 45 * |
46 * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h | 46 * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h |
47 */ | 47 */ |
48 | 48 |
49 #ifndef EGLAPI | 49 #ifndef EGLAPI |
50 #define EGLAPI //KHRONOS_APICALL | 50 #define EGLAPI KHRONOS_APICALL |
51 #endif | 51 #endif |
52 | 52 |
53 #ifndef EGLAPIENTRY | 53 #ifndef EGLAPIENTRY |
54 #define EGLAPIENTRY //KHRONOS_APIENTRY | 54 #define EGLAPIENTRY KHRONOS_APIENTRY |
55 #endif | 55 #endif |
56 #define EGLAPIENTRYP EGLAPIENTRY* | 56 #define EGLAPIENTRYP EGLAPIENTRY* |
57 | 57 |
58 /* The types NativeDisplayType, NativeWindowType, and NativePixmapType | 58 /* The types NativeDisplayType, NativeWindowType, and NativePixmapType |
59 * are aliases of window-system-dependent types, such as X Display * or | 59 * are aliases of window-system-dependent types, such as X Display * or |
60 * Windows Device Context. They must be defined in platform-specific | 60 * Windows Device Context. They must be defined in platform-specific |
61 * code below. The EGL-prefixed versions of Native*Type are the same | 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". | 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. |
63 */ | 68 */ |
64 | 69 |
65 #if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__S
CITECH_SNAP__) /* Win32 and WinCE */ | 70 #if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__S
CITECH_SNAP__) /* Win32 and WinCE */ |
66 #ifndef WIN32_LEAN_AND_MEAN | 71 #ifndef WIN32_LEAN_AND_MEAN |
67 #define WIN32_LEAN_AND_MEAN 1 | 72 #define WIN32_LEAN_AND_MEAN 1 |
68 #endif | 73 #endif |
69 #include <windows.h> | 74 #include <windows.h> |
70 | 75 |
71 typedef HDC EGLNativeDisplayType; | 76 typedef HDC EGLNativeDisplayType; |
72 typedef HBITMAP EGLNativePixmapType; | 77 typedef HBITMAP EGLNativePixmapType; |
73 typedef HWND EGLNativeWindowType; | 78 typedef HWND EGLNativeWindowType; |
74 | 79 |
75 #elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ | 80 #elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ |
76 | 81 |
77 typedef int EGLNativeDisplayType; | 82 typedef int EGLNativeDisplayType; |
78 typedef void *EGLNativeWindowType; | 83 typedef void *EGLNativeWindowType; |
79 typedef void *EGLNativePixmapType; | 84 typedef void *EGLNativePixmapType; |
80 | 85 |
81 #elif defined(__unix__) | 86 #elif defined(__unix__) |
82 | 87 |
83 /* X11 (tentative) */ | 88 /* X11 (tentative) */ |
84 #include <X11/Xlib.h> | 89 #include <X11/Xlib.h> |
85 #include <X11/Xutil.h> | 90 #include <X11/Xutil.h> |
86 | 91 |
87 typedef Display *EGLNativeDisplayType; | 92 typedef Display *EGLNativeDisplayType; |
88 typedef Pixmap EGLNativePixmapType; | 93 typedef Pixmap EGLNativePixmapType; |
89 typedef Window EGLNativeWindowType; | 94 typedef Window EGLNativeWindowType; |
90 | 95 |
91 #elif defined(__APPLE__) | |
92 | |
93 // TODO(gman): these are place holders. | |
94 typedef void *EGLNativeDisplayType; | |
95 typedef int EGLNativePixmapType; | |
96 typedef int EGLNativeWindowType; | |
97 | |
98 #else | 96 #else |
99 #error "Platform not recognized" | 97 #error "Platform not recognized" |
100 #endif | 98 #endif |
101 | 99 |
102 /* EGL 1.2 types, renamed for consistency in EGL 1.3 */ | 100 /* EGL 1.2 types, renamed for consistency in EGL 1.3 */ |
103 typedef EGLNativeDisplayType NativeDisplayType; | 101 typedef EGLNativeDisplayType NativeDisplayType; |
104 typedef EGLNativePixmapType NativePixmapType; | 102 typedef EGLNativePixmapType NativePixmapType; |
105 typedef EGLNativeWindowType NativeWindowType; | 103 typedef EGLNativeWindowType NativeWindowType; |
106 | 104 |
107 | 105 |
108 /* Define EGLint. This must be a signed integral type large enough to contain | 106 /* Define EGLint. This must be a signed integral type large enough to contain |
109 * all legal attribute names and values passed into and out of EGL, whether | 107 * all legal attribute names and values passed into and out of EGL, whether |
110 * their type is boolean, bitmask, enumerant (symbolic constant), integer, | 108 * their type is boolean, bitmask, enumerant (symbolic constant), integer, |
111 * handle, or other. While in general a 32-bit integer will suffice, if | 109 * handle, or other. While in general a 32-bit integer will suffice, if |
112 * handles are 64 bit types, then EGLint should be defined as a signed 64-bit | 110 * handles are 64 bit types, then EGLint should be defined as a signed 64-bit |
113 * integer type. | 111 * integer type. |
114 */ | 112 */ |
115 typedef khronos_int32_t EGLint; | 113 typedef khronos_int32_t EGLint; |
116 | 114 |
117 #endif /* __eglplatform_h */ | 115 #endif /* __eglplatform_h */ |
OLD | NEW |