1 #ifndef __eglplatform_h_
2 #define __eglplatform_h_
18 #include <KHR/khrplatform.h>
31 #define EGLAPI KHRONOS_APICALL
35 #define EGLAPIENTRY KHRONOS_APIENTRY
37 #define EGLAPIENTRYP EGLAPIENTRY*
51 #if defined(EGL_NO_PLATFORM_SPECIFIC_TYPES)
53 typedef void *EGLNativeDisplayType;
54 typedef void *EGLNativePixmapType;
55 typedef void *EGLNativeWindowType;
57 #elif defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
58 #ifndef WIN32_LEAN_AND_MEAN
59 #define WIN32_LEAN_AND_MEAN 1
63 typedef HDC EGLNativeDisplayType;
64 typedef HBITMAP EGLNativePixmapType;
65 typedef HWND EGLNativeWindowType;
67 #elif defined(__EMSCRIPTEN__)
69 typedef int EGLNativeDisplayType;
70 typedef int EGLNativePixmapType;
71 typedef int EGLNativeWindowType;
73 #elif defined(__WINSCW__) || defined(__SYMBIAN32__)
75 typedef int EGLNativeDisplayType;
76 typedef void *EGLNativePixmapType;
77 typedef void *EGLNativeWindowType;
79 #elif defined(WL_EGL_PLATFORM)
81 typedef struct wl_display *EGLNativeDisplayType;
82 typedef struct wl_egl_pixmap *EGLNativePixmapType;
83 typedef struct wl_egl_window *EGLNativeWindowType;
85 #elif defined(__GBM__)
87 typedef struct gbm_device *EGLNativeDisplayType;
88 typedef struct gbm_bo *EGLNativePixmapType;
89 typedef void *EGLNativeWindowType;
91 #elif defined(__ANDROID__) || defined(ANDROID)
94 struct egl_native_pixmap_t;
96 typedef void* EGLNativeDisplayType;
97 typedef struct egl_native_pixmap_t* EGLNativePixmapType;
98 typedef struct ANativeWindow* EGLNativeWindowType;
100 #elif defined(USE_OZONE)
102 typedef intptr_t EGLNativeDisplayType;
103 typedef intptr_t EGLNativePixmapType;
104 typedef intptr_t EGLNativeWindowType;
106 #elif defined(USE_X11)
109 #include <X11/Xlib.h>
110 #include <X11/Xutil.h>
112 typedef Display *EGLNativeDisplayType;
113 typedef Pixmap EGLNativePixmapType;
114 typedef Window EGLNativeWindowType;
116 #elif defined(__unix__)
118 typedef void *EGLNativeDisplayType;
119 typedef khronos_uintptr_t EGLNativePixmapType;
120 typedef khronos_uintptr_t EGLNativeWindowType;
122 #elif defined(__APPLE__)
124 typedef int EGLNativeDisplayType;
125 typedef void *EGLNativePixmapType;
126 typedef void *EGLNativeWindowType;
128 #elif defined(__HAIKU__)
130 #include <kernel/image.h>
132 typedef void *EGLNativeDisplayType;
133 typedef khronos_uintptr_t EGLNativePixmapType;
134 typedef khronos_uintptr_t EGLNativeWindowType;
136 #elif defined(__Fuchsia__)
138 typedef void *EGLNativeDisplayType;
139 typedef khronos_uintptr_t EGLNativePixmapType;
140 typedef khronos_uintptr_t EGLNativeWindowType;
143 #error "Platform not recognized"
147 typedef EGLNativeDisplayType NativeDisplayType;
148 typedef EGLNativePixmapType NativePixmapType;
149 typedef EGLNativeWindowType NativeWindowType;
159 typedef khronos_int32_t EGLint;
163 #if defined(__cplusplus)
164 #define EGL_CAST(type, value) (static_cast<type>(value))
166 #define EGL_CAST(type, value) ((type) (value))