summaryrefslogtreecommitdiff
path: root/include/EGL/eglplatform.h
blob: 09abb5d844a360056a080492ad26af9d05a48eee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/* -*- mode: c; tab-width: 8; -*- */
/* vi: set sw=4 ts=8: */
/* Platform-specific types and definitions for egl.h */

#ifndef __eglplatform_h_
#define __eglplatform_h_

/* Windows calling convention boilerplate */
#if (defined(WIN32) || defined(_WIN32_WCE))
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN		/* Exclude rarely-used stuff from Windows headers */
#endif
#include <windows.h>
#endif

#if !defined(_WIN32_WCE)
#include <sys/types.h>
#include <stdint.h>
#endif

#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
#  define EGLAPI __attribute__((visibility("default")))
#  define EGLAPIENTRY
#endif

/* Macros used in EGL function prototype declarations.
 *
 * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
 * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
 *
 * On Windows, EGLAPIENTRY can be defined like APIENTRY.
 * On most other platforms, it should be empty.
 */

#ifndef EGLAPIENTRY
#define EGLAPIENTRY
#endif
#ifndef EGLAPIENTRYP
#define EGLAPIENTRYP EGLAPIENTRY *
#endif

/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
 * are aliases of window-system-dependent types, such as X Display * or
 * Windows Device Context. They must be defined in platform-specific
 * code below. The EGL-prefixed versions of Native*Type are the same
 * types, renamed in EGL 1.3 so all types in the API start with "EGL".
 */

/* Unix (tentative)
    #include <X headers>
    typedef Display *NativeDisplayType;
      - or maybe, if encoding "hostname:display.head"
    typedef const char *NativeWindowType;
	etc.
 */


#if (defined(WIN32) || defined(_WIN32_WCE))

/** BEGIN Added for Windows **/
#ifndef EGLAPI
#define EGLAPI __declspec(dllexport)
#endif

typedef long	int32_t;
typedef unsigned long uint32_t;
typedef unsigned char uint8_t;
#define snprintf _snprintf
#define strcasecmp _stricmp
#define vsnprintf _vsnprintf

typedef HDC		NativeDisplayType;
typedef HWND	NativeWindowType;
typedef HBITMAP NativePixmapType;
/** END Added for Windows **/

#elif defined(__gnu_linux__) || defined(__FreeBSD__) || defined(__sun) || defined(__APPLE__)


/** BEGIN Added for X (Mesa) **/
#ifndef EGLAPI
#define EGLAPI extern
#endif

#include <X11/Xlib.h>
typedef Display *NativeDisplayType;
typedef Window NativeWindowType;
typedef Pixmap NativePixmapType;
/** END Added for X (Mesa) **/

#endif

/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
typedef NativeDisplayType EGLNativeDisplayType;
typedef NativePixmapType EGLNativePixmapType;
typedef NativeWindowType EGLNativeWindowType;

#endif /* __eglplatform_h */