Path: blob/main/system/include/EGL/eglplatform.h
6170 views
#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/* The types NativeDisplayType, NativeWindowType, and NativePixmapType58* are aliases of window-system-dependent types, such as X Display * or59* Windows Device Context. They must be defined in platform-specific60* code below. The EGL-prefixed versions of Native*Type are the same61* types, renamed in EGL 1.3 so all types in the API start with "EGL".62*63* Khronos STRONGLY RECOMMENDS that you use the default definitions64* provided below, since these changes affect both binary and source65* portability of applications using EGL running on different EGL66* implementations.67*/6869#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */70#ifndef WIN32_LEAN_AND_MEAN71#define WIN32_LEAN_AND_MEAN 172#endif73#include <windows.h>7475typedef HDC EGLNativeDisplayType;76typedef HBITMAP EGLNativePixmapType;77typedef HWND EGLNativeWindowType;7879#elif defined(__EMSCRIPTEN__)8081typedef void* EGLNativeDisplayType;82typedef int EGLNativePixmapType;83typedef int EGLNativeWindowType;8485#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */8687typedef int EGLNativeDisplayType;88typedef void *EGLNativePixmapType;89typedef void *EGLNativeWindowType;9091#elif defined(WL_EGL_PLATFORM)9293typedef struct wl_display *EGLNativeDisplayType;94typedef struct wl_egl_pixmap *EGLNativePixmapType;95typedef struct wl_egl_window *EGLNativeWindowType;9697#elif defined(__GBM__)9899typedef struct gbm_device *EGLNativeDisplayType;100typedef struct gbm_bo *EGLNativePixmapType;101typedef void *EGLNativeWindowType;102103#elif defined(__ANDROID__) || defined(ANDROID)104105struct ANativeWindow;106struct egl_native_pixmap_t;107108typedef void* EGLNativeDisplayType;109typedef struct egl_native_pixmap_t* EGLNativePixmapType;110typedef struct ANativeWindow* EGLNativeWindowType;111112#elif defined(USE_OZONE)113114typedef intptr_t EGLNativeDisplayType;115typedef intptr_t EGLNativePixmapType;116typedef intptr_t EGLNativeWindowType;117118#elif defined(__unix__) && defined(EGL_NO_X11)119120typedef void *EGLNativeDisplayType;121typedef khronos_uintptr_t EGLNativePixmapType;122typedef khronos_uintptr_t EGLNativeWindowType;123124#elif defined(__unix__) || defined(USE_X11)125126/* X11 (tentative) */127#include <X11/Xlib.h>128#include <X11/Xutil.h>129130typedef Display *EGLNativeDisplayType;131typedef Pixmap EGLNativePixmapType;132typedef Window EGLNativeWindowType;133134#elif defined(__APPLE__)135136typedef int EGLNativeDisplayType;137typedef void *EGLNativePixmapType;138typedef void *EGLNativeWindowType;139140#elif defined(__HAIKU__)141142#include <kernel/image.h>143144typedef void *EGLNativeDisplayType;145typedef khronos_uintptr_t EGLNativePixmapType;146typedef khronos_uintptr_t EGLNativeWindowType;147148#elif defined(__Fuchsia__)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