Path: blob/master/thirdparty/angle/include/EGL/eglplatform.h
9907 views
#ifndef __eglplatform_h_1#define __eglplatform_h_23/*4** Copyright 2007-2020 The Khronos Group Inc.5** SPDX-License-Identifier: Apache-2.06*/78/* Platform-specific types and definitions for egl.h9*10* Adopters may modify khrplatform.h and this file to suit their platform.11* You are encouraged to submit all modifications to the Khronos group so that12* they can be included in future versions of this file. Please submit changes13* by filing an issue or pull request on the public Khronos EGL Registry, at14* https://www.github.com/KhronosGroup/EGL-Registry/15*/1617#include <KHR/khrplatform.h>1819/* Macros used in EGL function prototype declarations.20*21* EGL functions should be prototyped as:22*23* EGLAPI return-type EGLAPIENTRY eglFunction(arguments);24* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);25*26* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h27*/2829#ifndef EGLAPI30#define EGLAPI KHRONOS_APICALL31#endif3233#ifndef EGLAPIENTRY34#define EGLAPIENTRY KHRONOS_APIENTRY35#endif36#define EGLAPIENTRYP EGLAPIENTRY*3738/* The types NativeDisplayType, NativeWindowType, and NativePixmapType39* are aliases of window-system-dependent types, such as X Display * or40* Windows Device Context. They must be defined in platform-specific41* code below. The EGL-prefixed versions of Native*Type are the same42* types, renamed in EGL 1.3 so all types in the API start with "EGL".43*44* Khronos STRONGLY RECOMMENDS that you use the default definitions45* provided below, since these changes affect both binary and source46* portability of applications using EGL running on different EGL47* implementations.48*/4950#if defined(EGL_NO_PLATFORM_SPECIFIC_TYPES)5152typedef void *EGLNativeDisplayType;53typedef void *EGLNativePixmapType;54typedef void *EGLNativeWindowType;5556#elif defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */57#ifndef WIN32_LEAN_AND_MEAN58#define WIN32_LEAN_AND_MEAN 159#endif60#include <windows.h>6162typedef HDC EGLNativeDisplayType;63typedef HBITMAP EGLNativePixmapType;6465#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) /* Windows Desktop */66typedef HWND EGLNativeWindowType;67#else /* Windows Store */68#include <inspectable.h>69typedef IInspectable* EGLNativeWindowType;70#endif7172#elif defined(__EMSCRIPTEN__)7374typedef int EGLNativeDisplayType;75typedef int EGLNativePixmapType;76typedef int EGLNativeWindowType;7778#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */7980typedef int EGLNativeDisplayType;81typedef void *EGLNativePixmapType;82typedef void *EGLNativeWindowType;8384#elif defined(WL_EGL_PLATFORM)8586typedef struct wl_display *EGLNativeDisplayType;87typedef struct wl_egl_pixmap *EGLNativePixmapType;88typedef struct wl_egl_window *EGLNativeWindowType;8990#elif defined(__GBM__)9192typedef struct gbm_device *EGLNativeDisplayType;93typedef struct gbm_bo *EGLNativePixmapType;94typedef void *EGLNativeWindowType;9596#elif defined(__ANDROID__) || defined(ANDROID)9798struct ANativeWindow;99struct egl_native_pixmap_t;100101typedef void* EGLNativeDisplayType;102typedef struct egl_native_pixmap_t* EGLNativePixmapType;103typedef struct ANativeWindow* EGLNativeWindowType;104105#elif defined(USE_OZONE)106107typedef intptr_t EGLNativeDisplayType;108typedef intptr_t EGLNativePixmapType;109typedef intptr_t EGLNativeWindowType;110111#elif defined(USE_X11)112113/* X11 (tentative) */114#include <X11/Xlib.h>115#include <X11/Xutil.h>116117typedef Display *EGLNativeDisplayType;118typedef Pixmap EGLNativePixmapType;119typedef Window EGLNativeWindowType;120121#elif defined(__unix__)122123typedef void *EGLNativeDisplayType;124typedef khronos_uintptr_t EGLNativePixmapType;125typedef khronos_uintptr_t EGLNativeWindowType;126127#elif defined(__APPLE__)128129typedef int EGLNativeDisplayType;130typedef void *EGLNativePixmapType;131typedef void *EGLNativeWindowType;132133#elif defined(__HAIKU__)134135#include <kernel/image.h>136137typedef void *EGLNativeDisplayType;138typedef khronos_uintptr_t EGLNativePixmapType;139typedef khronos_uintptr_t EGLNativeWindowType;140141#elif defined(__Fuchsia__)142143typedef void *EGLNativeDisplayType;144typedef khronos_uintptr_t EGLNativePixmapType;145typedef khronos_uintptr_t EGLNativeWindowType;146147#else148#error "Platform not recognized"149#endif150151/* EGL 1.2 types, renamed for consistency in EGL 1.3 */152typedef EGLNativeDisplayType NativeDisplayType;153typedef EGLNativePixmapType NativePixmapType;154typedef EGLNativeWindowType NativeWindowType;155156157/* Define EGLint. This must be a signed integral type large enough to contain158* all legal attribute names and values passed into and out of EGL, whether159* their type is boolean, bitmask, enumerant (symbolic constant), integer,160* handle, or other. While in general a 32-bit integer will suffice, if161* handles are 64 bit types, then EGLint should be defined as a signed 64-bit162* integer type.163*/164typedef khronos_int32_t EGLint;165166167/* C++ / C typecast macros for special EGL handle values */168#if defined(__cplusplus)169#define EGL_CAST(type, value) (static_cast<type>(value))170#else171#define EGL_CAST(type, value) ((type) (value))172#endif173174#endif /* __eglplatform_h */175176177