Subversion Repositories Kolibri OS

Rev

Rev 4358 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4379 Serge 1
#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
28
 * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
29
 *
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 
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
#if defined(BUILD_GL32)
50
#   define EGLAPI __declspec(dllexport)
51
#else
52
#   define EGLAPI __declspec(dllimport)
53
#endif
54
 
55
#ifndef EGLAPIENTRY
56
#define EGLAPIENTRY  KHRONOS_APIENTRY
57
#endif
58
#define EGLAPIENTRYP EGLAPIENTRY*
59
 
60
/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
61
 * are aliases of window-system-dependent types, such as X Display * or
62
 * Windows Device Context. They must be defined in platform-specific
63
 * code below. The EGL-prefixed versions of Native*Type are the same
64
 * types, renamed in EGL 1.3 so all types in the API start with "EGL".
65
 *
66
 * Khronos STRONGLY RECOMMENDS that you use the default definitions
67
 * provided below, since these changes affect both binary and source
68
 * portability of applications using EGL running on different EGL
69
 * implementations.
70
 */
71
 
72
#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
73
#ifndef WIN32_LEAN_AND_MEAN
74
#define WIN32_LEAN_AND_MEAN 1
75
#endif
76
#include 
77
 
78
typedef HDC     EGLNativeDisplayType;
79
typedef HBITMAP EGLNativePixmapType;
80
typedef HWND    EGLNativeWindowType;
81
 
82
#elif defined(__WINSCW__) || defined(__SYMBIAN32__)  /* Symbian */
83
 
84
typedef int   EGLNativeDisplayType;
85
typedef void *EGLNativeWindowType;
86
typedef void *EGLNativePixmapType;
87
 
88
#elif defined(WL_EGL_PLATFORM)
89
 
90
typedef struct wl_display     *EGLNativeDisplayType;
91
typedef struct wl_egl_pixmap  *EGLNativePixmapType;
92
typedef struct wl_egl_window  *EGLNativeWindowType;
93
 
94
#elif defined(__GBM__)
95
 
96
typedef struct gbm_device  *EGLNativeDisplayType;
97
typedef struct gbm_bo      *EGLNativePixmapType;
98
typedef void               *EGLNativeWindowType;
99
 
100
#elif defined(ANDROID) /* Android */
101
 
102
struct ANativeWindow;
103
struct egl_native_pixmap_t;
104
 
105
typedef struct ANativeWindow        *EGLNativeWindowType;
106
typedef struct egl_native_pixmap_t  *EGLNativePixmapType;
107
typedef void                        *EGLNativeDisplayType;
108
 
109
#elif defined(__unix__)
110
 
111
#ifdef MESA_EGL_NO_X11_HEADERS
112
 
113
typedef void            *EGLNativeDisplayType;
114
typedef khronos_uintptr_t EGLNativePixmapType;
115
typedef khronos_uintptr_t EGLNativeWindowType;
116
 
117
#else
118
 
119
/* X11 (tentative)  */
120
#include 
121
#include 
122
 
123
typedef Display *EGLNativeDisplayType;
124
typedef Pixmap   EGLNativePixmapType;
125
typedef Window   EGLNativeWindowType;
126
 
127
#endif /* MESA_EGL_NO_X11_HEADERS */
128
 
129
#else
130
#error "Platform not recognized"
131
#endif
132
 
133
/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
134
typedef EGLNativeDisplayType NativeDisplayType;
135
typedef EGLNativePixmapType  NativePixmapType;
136
typedef EGLNativeWindowType  NativeWindowType;
137
 
138
 
139
/* Define EGLint. This must be a signed integral type large enough to contain
140
 * all legal attribute names and values passed into and out of EGL, whether
141
 * their type is boolean, bitmask, enumerant (symbolic constant), integer,
142
 * handle, or other.  While in general a 32-bit integer will suffice, if
143
 * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
144
 * integer type.
145
 */
146
typedef khronos_int32_t EGLint;
147
 
148
#endif /* __eglplatform_h */