1#![cfg(any(
2 windows,
3 target_os = "linux",
4 target_os = "android",
5 target_os = "dragonfly",
6 target_os = "freebsd",
7 target_os = "netbsd",
8 target_os = "openbsd"
9))]
10#![allow(non_camel_case_types)]
11#![allow(clippy::missing_safety_doc)]
12#![allow(clippy::manual_non_exhaustive)]
13#![allow(clippy::unnecessary_cast)]
14
15pub mod egl {
16 pub type khronos_utime_nanoseconds_t = super::khronos_utime_nanoseconds_t;
17 pub type khronos_uint64_t = super::khronos_uint64_t;
18 pub type khronos_ssize_t = super::khronos_ssize_t;
19 pub type EGLNativeDisplayType = super::EGLNativeDisplayType;
20 pub type EGLNativePixmapType = super::EGLNativePixmapType;
21 pub type EGLNativeWindowType = super::EGLNativeWindowType;
22 pub type EGLint = super::EGLint;
23 pub type NativeDisplayType = super::EGLNativeDisplayType;
24 pub type NativePixmapType = super::EGLNativePixmapType;
25 pub type NativeWindowType = super::EGLNativeWindowType;
26
27 include!(concat!(env!("OUT_DIR"), "/egl_bindings.rs"));
28
29 // TODO should upstream these:
30 // EGL_EXT_platform_xcb
31 pub const PLATFORM_XCB_EXT: super::EGLenum = 0x31DC;
32 pub const PLATFORM_XCB_SCREEN_EXT: super::EGLenum = 0x31DE;
33 // EGL_EXT_device_query_name
34 pub const RENDERER_EXT: super::EGLenum = 0x335F;
35 // EGL_ANGLE_platform_angle - https://chromium.googlesource.com/angle/angle/+/HEAD/extensions/EGL_ANGLE_platform_angle.txt
36 pub const PLATFORM_ANGLE_ANGLE: super::EGLenum = 0x3202;
37 pub const PLATFORM_ANGLE_TYPE_ANGLE: super::EGLenum = 0x3203;
38 pub const PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE: super::EGLenum = 0x3204;
39 pub const PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE: super::EGLenum = 0x3205;
40 pub const PLATFORM_ANGLE_DEBUG_LAYERS_ENABLED: super::EGLenum = 0x3451;
41 pub const PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE: super::EGLenum = 0x348F;
42 pub const PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE: super::EGLenum = 0x3206;
43 pub const PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE: super::EGLenum = 0x320A;
44 pub const PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE: super::EGLenum = 0x345E;
45}
46
47pub use self::egl::types::{EGLContext, EGLDisplay};
48
49use std::os::raw;
50
51pub type khronos_utime_nanoseconds_t = khronos_uint64_t;
52pub type khronos_uint64_t = u64;
53pub type khronos_ssize_t = raw::c_long;
54pub type EGLint = i32;
55pub type EGLenum = raw::c_uint;
56pub type EGLNativeDisplayType = *const raw::c_void;
57
58// FIXME: egl_native_pixmap_t instead
59#[cfg(windows)]
60pub type EGLNativePixmapType = windows_sys::Win32::Graphics::Gdi::HBITMAP;
61#[cfg(not(windows))]
62pub type EGLNativePixmapType = *const raw::c_void;
63
64#[cfg(windows)]
65pub type EGLNativeWindowType = windows_sys::Win32::Foundation::HWND;
66#[cfg(not(windows))]
67pub type EGLNativeWindowType = *const raw::c_void;
68