#ifndef __eglplatform_h_1#define __eglplatform_h_23/*4** Copyright (c) 2007-2016 The Khronos Group Inc.5**6** Permission is hereby granted, free of charge, to any person obtaining a7** copy of this software and/or associated documentation files (the8** "Materials"), to deal in the Materials without restriction, including9** without limitation the rights to use, copy, modify, merge, publish,10** distribute, sublicense, and/or sell copies of the Materials, and to11** permit persons to whom the Materials are furnished to do so, subject to12** the following conditions:13**14** The above copyright notice and this permission notice shall be included15** in all copies or substantial portions of the Materials.16**17** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,18** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.20** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY21** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.24*/2526/* Platform-specific types and definitions for egl.h27* $Revision: 30994 $ on $Date: 2015-04-30 13:36:48 -0700 (Thu, 30 Apr 2015) $28*29* Adopters may modify khrplatform.h and this file to suit their platform.30* You are encouraged to submit all modifications to the Khronos group so that31* they can be included in future versions of this file. Please submit changes32* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)33* by filing a bug against product "EGL" component "Registry".34*/3536#include <KHR/khrplatform.h>3738/* Macros used in EGL function prototype declarations.39*40* EGL functions should be prototyped as:41*42* EGLAPI return-type EGLAPIENTRY eglFunction(arguments);43* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);44*45* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h46*/4748#ifndef EGLAPI49#define EGLAPI KHRONOS_APICALL50#endif5152#ifndef EGLAPIENTRY53#define EGLAPIENTRY KHRONOS_APIENTRY54#endif55#define EGLAPIENTRYP EGLAPIENTRY*5657#if defined(MESA_EGL_NO_X11_HEADERS) && !defined(EGL_NO_X11)58#warning "`MESA_EGL_NO_X11_HEADERS` is deprecated, and doesn't work with the unmodified Khronos header"59#warning "Please use `EGL_NO_X11` instead, as `MESA_EGL_NO_X11_HEADERS` will be removed soon"60#define EGL_NO_X1161#endif6263/* The types NativeDisplayType, NativeWindowType, and NativePixmapType64* are aliases of window-system-dependent types, such as X Display * or65* Windows Device Context. They must be defined in platform-specific66* code below. The EGL-prefixed versions of Native*Type are the same67* types, renamed in EGL 1.3 so all types in the API start with "EGL".68*69* Khronos STRONGLY RECOMMENDS that you use the default definitions70* provided below, since these changes affect both binary and source71* portability of applications using EGL running on different EGL72* implementations.73*/7475#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */76#ifndef WIN32_LEAN_AND_MEAN77#define WIN32_LEAN_AND_MEAN 178#endif79#include <windows.h>8081typedef HDC EGLNativeDisplayType;82typedef HBITMAP EGLNativePixmapType;83typedef HWND EGLNativeWindowType;8485#elif defined(__EMSCRIPTEN__)8687typedef int EGLNativeDisplayType;88typedef int EGLNativePixmapType;89typedef int EGLNativeWindowType;9091#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */9293typedef int EGLNativeDisplayType;94typedef void *EGLNativePixmapType;95typedef void *EGLNativeWindowType;9697#elif defined(WL_EGL_PLATFORM)9899typedef struct wl_display *EGLNativeDisplayType;100typedef struct wl_egl_pixmap *EGLNativePixmapType;101typedef struct wl_egl_window *EGLNativeWindowType;102103#elif defined(__GBM__)104105typedef struct gbm_device *EGLNativeDisplayType;106typedef struct gbm_bo *EGLNativePixmapType;107typedef void *EGLNativeWindowType;108109#elif defined(__ANDROID__) || defined(ANDROID)110111struct ANativeWindow;112struct egl_native_pixmap_t;113114typedef void* EGLNativeDisplayType;115typedef struct egl_native_pixmap_t* EGLNativePixmapType;116typedef struct ANativeWindow* EGLNativeWindowType;117118#elif defined(USE_OZONE)119120typedef intptr_t EGLNativeDisplayType;121typedef intptr_t EGLNativePixmapType;122typedef intptr_t EGLNativeWindowType;123124#elif defined(__unix__) && defined(EGL_NO_X11)125126typedef void *EGLNativeDisplayType;127typedef khronos_uintptr_t EGLNativePixmapType;128typedef khronos_uintptr_t EGLNativeWindowType;129130#elif defined(__unix__) || defined(USE_X11)131132/* X11 (tentative) */133#include <X11/Xlib.h>134#include <X11/Xutil.h>135136typedef Display *EGLNativeDisplayType;137typedef Pixmap EGLNativePixmapType;138typedef Window EGLNativeWindowType;139140#elif defined(__APPLE__)141142typedef int EGLNativeDisplayType;143typedef void *EGLNativePixmapType;144typedef void *EGLNativeWindowType;145146#elif defined(__HAIKU__)147148#include <kernel/image.h>149150typedef void *EGLNativeDisplayType;151typedef khronos_uintptr_t EGLNativePixmapType;152typedef khronos_uintptr_t EGLNativeWindowType;153154#else155#error "Platform not recognized"156#endif157158/* EGL 1.2 types, renamed for consistency in EGL 1.3 */159typedef EGLNativeDisplayType NativeDisplayType;160typedef EGLNativePixmapType NativePixmapType;161typedef EGLNativeWindowType NativeWindowType;162163164/* Define EGLint. This must be a signed integral type large enough to contain165* all legal attribute names and values passed into and out of EGL, whether166* their type is boolean, bitmask, enumerant (symbolic constant), integer,167* handle, or other. While in general a 32-bit integer will suffice, if168* handles are 64 bit types, then EGLint should be defined as a signed 64-bit169* integer type.170*/171typedef khronos_int32_t EGLint;172173174/* C++ / C typecast macros for special EGL handle values */175#if defined(__cplusplus)176#define EGL_CAST(type, value) (static_cast<type>(value))177#else178#define EGL_CAST(type, value) ((type) (value))179#endif180181#endif /* __eglplatform_h */182183184