blob: a2c6a7d8edae582dd099d3252a8851f6328c87eb [file] [log] [blame]
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08001#ifndef __eglplatform_h_
2#define __eglplatform_h_
3
4/*
5** Copyright (c) 2007-2009 The Khronos Group Inc.
6**
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:
14**
15** The above copyright notice and this permission notice shall be included
16** in all copies or substantial portions of the Materials.
17**
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.
25*/
26
27/* Platform-specific types and definitions for egl.h
Mathias Agopiane81a3cb2010-06-09 18:46:35 -070028 * $Revision: 9724 $ on $Date: 2009-12-02 02:05:33 -0800 (Wed, 02 Dec 2009) $
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080029 *
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".
35 */
36
37#include <KHR/khrplatform.h>
38
39/* Macros used in EGL function prototype declarations.
40 *
41 * EGL functions should be prototyped as:
42 *
43 * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
44 * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
45 *
46 * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
47 */
48
49#ifndef EGLAPI
50#define EGLAPI KHRONOS_APICALL
51#endif
52
Mathias Agopiane81a3cb2010-06-09 18:46:35 -070053#ifndef EGLAPIENTRY
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080054#define EGLAPIENTRY KHRONOS_APIENTRY
Mathias Agopiane81a3cb2010-06-09 18:46:35 -070055#endif
56#define EGLAPIENTRYP EGLAPIENTRY*
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080057
58/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
59 * are aliases of window-system-dependent types, such as X Display * or
60 * Windows Device Context. They must be defined in platform-specific
61 * code below. The EGL-prefixed versions of Native*Type are the same
62 * types, renamed in EGL 1.3 so all types in the API start with "EGL".
63 */
64
65#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
66#ifndef WIN32_LEAN_AND_MEAN
67#define WIN32_LEAN_AND_MEAN 1
68#endif
69#include <windows.h>
70
71typedef HDC EGLNativeDisplayType;
72typedef HBITMAP EGLNativePixmapType;
73typedef HWND EGLNativeWindowType;
74
75#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
76
77typedef int EGLNativeDisplayType;
78typedef void *EGLNativeWindowType;
79typedef void *EGLNativePixmapType;
80
81#elif defined(__unix__) && !defined(ANDROID)
82
83/* X11 (tentative) */
84#include <X11/Xlib.h>
85#include <X11/Xutil.h>
86
87typedef Display *EGLNativeDisplayType;
88typedef Pixmap EGLNativePixmapType;
89typedef Window EGLNativeWindowType;
90
91
92#elif defined(ANDROID)
93
Mathias Agopian7189c002009-05-05 18:11:11 -070094struct android_native_window_t;
95struct egl_native_pixmap_t;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080096
Mathias Agopian076b1cc2009-04-10 14:24:30 -070097typedef struct android_native_window_t* EGLNativeWindowType;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080098typedef struct egl_native_pixmap_t* EGLNativePixmapType;
99typedef void* EGLNativeDisplayType;
100
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800101#else
102#error "Platform not recognized"
103#endif
104
105/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
106typedef EGLNativeDisplayType NativeDisplayType;
107typedef EGLNativePixmapType NativePixmapType;
108typedef EGLNativeWindowType NativeWindowType;
109
110
111/* Define EGLint. This must be a signed integral type large enough to contain
112 * all legal attribute names and values passed into and out of EGL, whether
113 * their type is boolean, bitmask, enumerant (symbolic constant), integer,
114 * handle, or other. While in general a 32-bit integer will suffice, if
115 * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
116 * integer type.
117 */
118typedef khronos_int32_t EGLint;
119
120#endif /* __eglplatform_h */