Blame include/EGL/eglplatform.h

Packit 5af8b3
#ifndef __eglplatform_h_
Packit 5af8b3
#define __eglplatform_h_
Packit 5af8b3
Packit 5af8b3
/*
Packit 5af8b3
** Copyright (c) 2007-2016 The Khronos Group Inc.
Packit 5af8b3
**
Packit 5af8b3
** Permission is hereby granted, free of charge, to any person obtaining a
Packit 5af8b3
** copy of this software and/or associated documentation files (the
Packit 5af8b3
** "Materials"), to deal in the Materials without restriction, including
Packit 5af8b3
** without limitation the rights to use, copy, modify, merge, publish,
Packit 5af8b3
** distribute, sublicense, and/or sell copies of the Materials, and to
Packit 5af8b3
** permit persons to whom the Materials are furnished to do so, subject to
Packit 5af8b3
** the following conditions:
Packit 5af8b3
**
Packit 5af8b3
** The above copyright notice and this permission notice shall be included
Packit 5af8b3
** in all copies or substantial portions of the Materials.
Packit 5af8b3
**
Packit 5af8b3
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Packit 5af8b3
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Packit 5af8b3
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Packit 5af8b3
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
Packit 5af8b3
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
Packit 5af8b3
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
Packit 5af8b3
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
Packit 5af8b3
*/
Packit 5af8b3
Packit 5af8b3
/* Platform-specific types and definitions for egl.h
Packit 5af8b3
 * $Revision: 30994 $ on $Date: 2015-04-30 13:36:48 -0700 (Thu, 30 Apr 2015) $
Packit 5af8b3
 *
Packit 5af8b3
 * Adopters may modify khrplatform.h and this file to suit their platform.
Packit 5af8b3
 * You are encouraged to submit all modifications to the Khronos group so that
Packit 5af8b3
 * they can be included in future versions of this file.  Please submit changes
Packit 5af8b3
 * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
Packit 5af8b3
 * by filing a bug against product "EGL" component "Registry".
Packit 5af8b3
 */
Packit 5af8b3
Packit 5af8b3
#include <KHR/khrplatform.h>
Packit 5af8b3
Packit 5af8b3
/* Macros used in EGL function prototype declarations.
Packit 5af8b3
 *
Packit 5af8b3
 * EGL functions should be prototyped as:
Packit 5af8b3
 *
Packit 5af8b3
 * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
Packit 5af8b3
 * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
Packit 5af8b3
 *
Packit 5af8b3
 * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
Packit 5af8b3
 */
Packit 5af8b3
Packit 5af8b3
#ifndef EGLAPI
Packit 5af8b3
#define EGLAPI KHRONOS_APICALL
Packit 5af8b3
#endif
Packit 5af8b3
Packit 5af8b3
#ifndef EGLAPIENTRY
Packit 5af8b3
#define EGLAPIENTRY  KHRONOS_APIENTRY
Packit 5af8b3
#endif
Packit 5af8b3
#define EGLAPIENTRYP EGLAPIENTRY*
Packit 5af8b3
Packit 5af8b3
/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
Packit 5af8b3
 * are aliases of window-system-dependent types, such as X Display * or
Packit 5af8b3
 * Windows Device Context. They must be defined in platform-specific
Packit 5af8b3
 * code below. The EGL-prefixed versions of Native*Type are the same
Packit 5af8b3
 * types, renamed in EGL 1.3 so all types in the API start with "EGL".
Packit 5af8b3
 *
Packit 5af8b3
 * Khronos STRONGLY RECOMMENDS that you use the default definitions
Packit 5af8b3
 * provided below, since these changes affect both binary and source
Packit 5af8b3
 * portability of applications using EGL running on different EGL
Packit 5af8b3
 * implementations.
Packit 5af8b3
 */
Packit 5af8b3
Packit 5af8b3
#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
Packit 5af8b3
#ifndef WIN32_LEAN_AND_MEAN
Packit 5af8b3
#define WIN32_LEAN_AND_MEAN 1
Packit 5af8b3
#endif
Packit 5af8b3
#include <windows.h>
Packit 5af8b3
Packit 5af8b3
typedef HDC     EGLNativeDisplayType;
Packit 5af8b3
typedef HBITMAP EGLNativePixmapType;
Packit 5af8b3
typedef HWND    EGLNativeWindowType;
Packit 5af8b3
Packit 5af8b3
#elif defined(__EMSCRIPTEN__)
Packit 5af8b3
Packit 5af8b3
typedef int EGLNativeDisplayType;
Packit 5af8b3
typedef int EGLNativePixmapType;
Packit 5af8b3
typedef int EGLNativeWindowType;
Packit 5af8b3
Packit 5af8b3
#elif defined(__WINSCW__) || defined(__SYMBIAN32__)  /* Symbian */
Packit 5af8b3
Packit 5af8b3
typedef int   EGLNativeDisplayType;
Packit 5af8b3
typedef void *EGLNativePixmapType;
Packit 5af8b3
typedef void *EGLNativeWindowType;
Packit 5af8b3
Packit 5af8b3
#elif defined(WL_EGL_PLATFORM)
Packit 5af8b3
Packit 5af8b3
typedef struct wl_display     *EGLNativeDisplayType;
Packit 5af8b3
typedef struct wl_egl_pixmap  *EGLNativePixmapType;
Packit 5af8b3
typedef struct wl_egl_window  *EGLNativeWindowType;
Packit 5af8b3
Packit 5af8b3
#elif defined(__GBM__)
Packit 5af8b3
Packit 5af8b3
typedef struct gbm_device  *EGLNativeDisplayType;
Packit 5af8b3
typedef struct gbm_bo      *EGLNativePixmapType;
Packit 5af8b3
typedef void               *EGLNativeWindowType;
Packit 5af8b3
Packit 5af8b3
#elif defined(__ANDROID__) || defined(ANDROID)
Packit 5af8b3
Packit 5af8b3
struct ANativeWindow;
Packit 5af8b3
struct egl_native_pixmap_t;
Packit 5af8b3
Packit 5af8b3
typedef void*                           EGLNativeDisplayType;
Packit 5af8b3
typedef struct egl_native_pixmap_t*     EGLNativePixmapType;
Packit 5af8b3
typedef struct ANativeWindow*           EGLNativeWindowType;
Packit 5af8b3
Packit 5af8b3
#elif defined(USE_OZONE)
Packit 5af8b3
Packit 5af8b3
typedef intptr_t EGLNativeDisplayType;
Packit 5af8b3
typedef intptr_t EGLNativePixmapType;
Packit 5af8b3
typedef intptr_t EGLNativeWindowType;
Packit 5af8b3
Packit 129ef3
#elif defined(__unix__) && defined(EGL_NO_X11)
Packit 129ef3
Packit 129ef3
typedef void             *EGLNativeDisplayType;
Packit 129ef3
typedef khronos_uintptr_t EGLNativePixmapType;
Packit 129ef3
typedef khronos_uintptr_t EGLNativeWindowType;
Packit 129ef3
Packit 5af8b3
#elif defined(__unix__) || defined(USE_X11)
Packit 5af8b3
Packit 5af8b3
/* X11 (tentative)  */
Packit 5af8b3
#include <X11/Xlib.h>
Packit 5af8b3
#include <X11/Xutil.h>
Packit 5af8b3
Packit 5af8b3
typedef Display *EGLNativeDisplayType;
Packit 5af8b3
typedef Pixmap   EGLNativePixmapType;
Packit 5af8b3
typedef Window   EGLNativeWindowType;
Packit 5af8b3
Packit 5af8b3
#elif defined(__APPLE__)
Packit 5af8b3
Packit 5af8b3
typedef int   EGLNativeDisplayType;
Packit 5af8b3
typedef void *EGLNativePixmapType;
Packit 5af8b3
typedef void *EGLNativeWindowType;
Packit 5af8b3
Packit 5af8b3
#elif defined(__HAIKU__)
Packit 5af8b3
Packit 5af8b3
#include <kernel/image.h>
Packit 5af8b3
Packit 5af8b3
typedef void              *EGLNativeDisplayType;
Packit 5af8b3
typedef khronos_uintptr_t  EGLNativePixmapType;
Packit 5af8b3
typedef khronos_uintptr_t  EGLNativeWindowType;
Packit 5af8b3
Packit 5af8b3
#else
Packit 5af8b3
#error "Platform not recognized"
Packit 5af8b3
#endif
Packit 5af8b3
Packit 5af8b3
/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
Packit 5af8b3
typedef EGLNativeDisplayType NativeDisplayType;
Packit 5af8b3
typedef EGLNativePixmapType  NativePixmapType;
Packit 5af8b3
typedef EGLNativeWindowType  NativeWindowType;
Packit 5af8b3
Packit 5af8b3
Packit 5af8b3
/* Define EGLint. This must be a signed integral type large enough to contain
Packit 5af8b3
 * all legal attribute names and values passed into and out of EGL, whether
Packit 5af8b3
 * their type is boolean, bitmask, enumerant (symbolic constant), integer,
Packit 5af8b3
 * handle, or other.  While in general a 32-bit integer will suffice, if
Packit 5af8b3
 * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
Packit 5af8b3
 * integer type.
Packit 5af8b3
 */
Packit 5af8b3
typedef khronos_int32_t EGLint;
Packit 5af8b3
Packit 5af8b3
Packit 5af8b3
/* C++ / C typecast macros for special EGL handle values */
Packit 5af8b3
#if defined(__cplusplus)
Packit 5af8b3
#define EGL_CAST(type, value) (static_cast<type>(value))
Packit 5af8b3
#else
Packit 5af8b3
#define EGL_CAST(type, value) ((type) (value))
Packit 5af8b3
#endif
Packit 5af8b3
Packit 5af8b3
#endif /* __eglplatform_h */