1
#ifndef __eglplatform_h_
2
#define __eglplatform_h_
5
** Copyright (c) 2007-2009 The Khronos Group Inc.
7
** Permission is hereby granted, free of charge, to any person obtaining a
8
** copy of this software and/or associated documentation files (the
9
** "Materials"), to deal in the Materials without restriction, including
10
** without limitation the rights to use, copy, modify, merge, publish,
11
** distribute, sublicense, and/or sell copies of the Materials, and to
12
** permit persons to whom the Materials are furnished to do so, subject to
13
** the following conditions:
15
** The above copyright notice and this permission notice shall be included
16
** in all copies or substantial portions of the Materials.
18
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
27
/* Platform-specific types and definitions for egl.h
28
* $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
30
* Adopters may modify khrplatform.h and this file to suit their platform.
31
* You are encouraged to submit all modifications to the Khronos group so that
32
* they can be included in future versions of this file. Please submit changes
33
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
34
* by filing a bug against product "EGL" component "Registry".
37
#include <KHR/khrplatform.h>
39
/* Macros used in EGL function prototype declarations.
41
* EGL functions should be prototyped as:
43
* EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
44
* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
46
* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
49
#ifndef LIBHYBRIS_WANTS_MESA_X11_HEADERS
50
#define MESA_EGL_NO_X11_HEADERS
54
#define EGLAPI KHRONOS_APICALL
58
#define EGLAPIENTRY KHRONOS_APIENTRY
60
#define EGLAPIENTRYP EGLAPIENTRY*
62
/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
63
* are aliases of window-system-dependent types, such as X Display * or
64
* Windows Device Context. They must be defined in platform-specific
65
* code below. The EGL-prefixed versions of Native*Type are the same
66
* types, renamed in EGL 1.3 so all types in the API start with "EGL".
68
* Khronos STRONGLY RECOMMENDS that you use the default definitions
69
* provided below, since these changes affect both binary and source
70
* portability of applications using EGL running on different EGL
74
#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
75
#ifndef WIN32_LEAN_AND_MEAN
76
#define WIN32_LEAN_AND_MEAN 1
80
typedef HDC EGLNativeDisplayType;
81
typedef HBITMAP EGLNativePixmapType;
82
typedef HWND EGLNativeWindowType;
84
#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
86
typedef int EGLNativeDisplayType;
87
typedef void *EGLNativeWindowType;
88
typedef void *EGLNativePixmapType;
90
#elif defined(WL_EGL_PLATFORM)
92
typedef struct wl_display *EGLNativeDisplayType;
93
typedef struct wl_egl_pixmap *EGLNativePixmapType;
94
typedef struct wl_egl_window *EGLNativeWindowType;
96
#elif defined(__GBM__)
98
typedef struct gbm_device *EGLNativeDisplayType;
99
typedef struct gbm_bo *EGLNativePixmapType;
100
typedef void *EGLNativeWindowType;
102
#elif defined(ANDROID) /* Android */
104
struct ANativeWindow;
105
struct egl_native_pixmap_t;
107
typedef struct ANativeWindow *EGLNativeWindowType;
108
typedef struct egl_native_pixmap_t *EGLNativePixmapType;
109
typedef void *EGLNativeDisplayType;
111
#elif defined(__unix__)
113
#ifdef MESA_EGL_NO_X11_HEADERS
115
typedef void *EGLNativeDisplayType;
116
typedef khronos_uint32_t EGLNativePixmapType;
117
typedef khronos_uint32_t EGLNativeWindowType;
121
/* X11 (tentative) */
122
#include <X11/Xlib.h>
123
#include <X11/Xutil.h>
125
typedef Display *EGLNativeDisplayType;
126
typedef Pixmap EGLNativePixmapType;
127
typedef Window EGLNativeWindowType;
129
#endif /* MESA_EGL_NO_X11_HEADERS */
132
#error "Platform not recognized"
135
/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
136
typedef EGLNativeDisplayType NativeDisplayType;
137
typedef EGLNativePixmapType NativePixmapType;
138
typedef EGLNativeWindowType NativeWindowType;
141
/* Define EGLint. This must be a signed integral type large enough to contain
142
* all legal attribute names and values passed into and out of EGL, whether
143
* their type is boolean, bitmask, enumerant (symbolic constant), integer,
144
* handle, or other. While in general a 32-bit integer will suffice, if
145
* handles are 64 bit types, then EGLint should be defined as a signed 64-bit
148
typedef khronos_int32_t EGLint;
150
#endif /* __eglplatform_h */