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