1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/angle/include/EGL/eglplatform.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,129 @@ 1.4 +#ifndef __eglplatform_h_ 1.5 +#define __eglplatform_h_ 1.6 + 1.7 +/* 1.8 +** Copyright (c) 2007-2009 The Khronos Group Inc. 1.9 +** 1.10 +** Permission is hereby granted, free of charge, to any person obtaining a 1.11 +** copy of this software and/or associated documentation files (the 1.12 +** "Materials"), to deal in the Materials without restriction, including 1.13 +** without limitation the rights to use, copy, modify, merge, publish, 1.14 +** distribute, sublicense, and/or sell copies of the Materials, and to 1.15 +** permit persons to whom the Materials are furnished to do so, subject to 1.16 +** the following conditions: 1.17 +** 1.18 +** The above copyright notice and this permission notice shall be included 1.19 +** in all copies or substantial portions of the Materials. 1.20 +** 1.21 +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 1.22 +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1.23 +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 1.24 +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 1.25 +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 1.26 +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 1.27 +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 1.28 +*/ 1.29 + 1.30 +/* Platform-specific types and definitions for egl.h 1.31 + * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $ 1.32 + * 1.33 + * Adopters may modify khrplatform.h and this file to suit their platform. 1.34 + * You are encouraged to submit all modifications to the Khronos group so that 1.35 + * they can be included in future versions of this file. Please submit changes 1.36 + * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 1.37 + * by filing a bug against product "EGL" component "Registry". 1.38 + */ 1.39 + 1.40 +#include <KHR/khrplatform.h> 1.41 + 1.42 +/* Macros used in EGL function prototype declarations. 1.43 + * 1.44 + * EGL functions should be prototyped as: 1.45 + * 1.46 + * EGLAPI return-type EGLAPIENTRY eglFunction(arguments); 1.47 + * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); 1.48 + * 1.49 + * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h 1.50 + */ 1.51 + 1.52 +#ifndef EGLAPI 1.53 +#define EGLAPI KHRONOS_APICALL 1.54 +#endif 1.55 + 1.56 +#ifndef EGLAPIENTRY 1.57 +#define EGLAPIENTRY KHRONOS_APIENTRY 1.58 +#endif 1.59 +#define EGLAPIENTRYP EGLAPIENTRY* 1.60 + 1.61 +/* The types NativeDisplayType, NativeWindowType, and NativePixmapType 1.62 + * are aliases of window-system-dependent types, such as X Display * or 1.63 + * Windows Device Context. They must be defined in platform-specific 1.64 + * code below. The EGL-prefixed versions of Native*Type are the same 1.65 + * types, renamed in EGL 1.3 so all types in the API start with "EGL". 1.66 + * 1.67 + * Khronos STRONGLY RECOMMENDS that you use the default definitions 1.68 + * provided below, since these changes affect both binary and source 1.69 + * portability of applications using EGL running on different EGL 1.70 + * implementations. 1.71 + */ 1.72 + 1.73 +#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ 1.74 +#ifndef WIN32_LEAN_AND_MEAN 1.75 +#define WIN32_LEAN_AND_MEAN 1 1.76 +#endif 1.77 +#include <windows.h> 1.78 + 1.79 +typedef HDC EGLNativeDisplayType; 1.80 +typedef HBITMAP EGLNativePixmapType; 1.81 +typedef HWND EGLNativeWindowType; 1.82 + 1.83 +#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ 1.84 + 1.85 +typedef int EGLNativeDisplayType; 1.86 +typedef void *EGLNativeWindowType; 1.87 +typedef void *EGLNativePixmapType; 1.88 + 1.89 +#elif defined(WL_EGL_PLATFORM) 1.90 + 1.91 +typedef struct wl_display *EGLNativeDisplayType; 1.92 +typedef struct wl_egl_pixmap *EGLNativePixmapType; 1.93 +typedef struct wl_egl_window *EGLNativeWindowType; 1.94 + 1.95 +#elif defined(__unix__) && !defined(ANDROID) 1.96 + 1.97 +/* X11 (tentative) */ 1.98 +#include <X11/Xlib.h> 1.99 +#include <X11/Xutil.h> 1.100 + 1.101 +typedef Display *EGLNativeDisplayType; 1.102 +typedef Pixmap EGLNativePixmapType; 1.103 +typedef Window EGLNativeWindowType; 1.104 + 1.105 +#elif defined(ANDROID) 1.106 + 1.107 +struct egl_native_pixmap_t; 1.108 + 1.109 +typedef struct ANativeWindow* EGLNativeWindowType; 1.110 +typedef struct egl_native_pixmap_t* EGLNativePixmapType; 1.111 +typedef void* EGLNativeDisplayType; 1.112 + 1.113 +#else 1.114 +#error "Platform not recognized" 1.115 +#endif 1.116 + 1.117 +/* EGL 1.2 types, renamed for consistency in EGL 1.3 */ 1.118 +typedef EGLNativeDisplayType NativeDisplayType; 1.119 +typedef EGLNativePixmapType NativePixmapType; 1.120 +typedef EGLNativeWindowType NativeWindowType; 1.121 + 1.122 + 1.123 +/* Define EGLint. This must be a signed integral type large enough to contain 1.124 + * all legal attribute names and values passed into and out of EGL, whether 1.125 + * their type is boolean, bitmask, enumerant (symbolic constant), integer, 1.126 + * handle, or other. While in general a 32-bit integer will suffice, if 1.127 + * handles are 64 bit types, then EGLint should be defined as a signed 64-bit 1.128 + * integer type. 1.129 + */ 1.130 +typedef khronos_int32_t EGLint; 1.131 + 1.132 +#endif /* __eglplatform_h */