Merge commit 'origin/master' into gallium-0.2
[mesa.git] / include / EGL / eglplatform.h
1 /* -*- mode: c; tab-width: 8; -*- */
2 /* vi: set sw=4 ts=8: */
3 /* Platform-specific types and definitions for egl.h */
4
5 #ifndef __eglplatform_h_
6 #define __eglplatform_h_
7
8 /* Windows calling convention boilerplate */
9 #if (defined(WIN32) || defined(_WIN32_WCE))
10 #ifndef WIN32_LEAN_AND_MEAN
11 #define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */
12 #endif
13 #include <windows.h>
14 #endif
15
16 #if !defined(_WIN32_WCE)
17 #include <sys/types.h>
18 #endif
19
20 /* Macros used in EGL function prototype declarations.
21 *
22 * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
23 * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
24 *
25 * On Windows, EGLAPIENTRY can be defined like APIENTRY.
26 * On most other platforms, it should be empty.
27 */
28
29 #ifndef EGLAPIENTRY
30 #define EGLAPIENTRY
31 #endif
32 #ifndef EGLAPIENTRYP
33 #define EGLAPIENTRYP EGLAPIENTRY *
34 #endif
35
36 /* The types NativeDisplayType, NativeWindowType, and NativePixmapType
37 * are aliases of window-system-dependent types, such as X Display * or
38 * Windows Device Context. They must be defined in platform-specific
39 * code below. The EGL-prefixed versions of Native*Type are the same
40 * types, renamed in EGL 1.3 so all types in the API start with "EGL".
41 */
42
43 /* Unix (tentative)
44 #include <X headers>
45 typedef Display *NativeDisplayType;
46 - or maybe, if encoding "hostname:display.head"
47 typedef const char *NativeWindowType;
48 etc.
49 */
50
51
52 #if (defined(WIN32) || defined(_WIN32_WCE))
53
54 /** BEGIN Added for Windows **/
55 #ifndef EGLAPI
56 #define EGLAPI __declspec(dllexport)
57 #endif
58
59 typedef long int32_t;
60 typedef unsigned long u_int32_t;
61 typedef unsigned char uint8_t;
62 #define snprintf _snprintf
63 #define strcasecmp _stricmp
64 #define vsnprintf _vsnprintf
65
66 typedef HDC NativeDisplayType;
67 typedef HWND NativeWindowType;
68 typedef HBITMAP NativePixmapType;
69 /** END Added for Windows **/
70
71 #elif defined(__gnu_linux__)
72
73 /** BEGIN Added for X (Mesa) **/
74 #ifndef EGLAPI
75 #define EGLAPI extern
76 #endif
77
78 #include <X11/Xlib.h>
79 typedef Display *NativeDisplayType;
80 typedef Window NativeWindowType;
81 typedef Pixmap NativePixmapType;
82 /** END Added for X (Mesa) **/
83
84 #endif
85
86 /* EGL 1.2 types, renamed for consistency in EGL 1.3 */
87 typedef NativeDisplayType EGLNativeDisplayType;
88 typedef NativePixmapType EGLNativePixmapType;
89 typedef NativeWindowType EGLNativeWindowType;
90
91 #endif /* __eglplatform_h */