diff options
| author | LLLL Colonq <llll@colonq> | 2026-04-26 22:56:52 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-04-26 22:59:25 -0400 |
| commit | d943ba194b3cfab18354e96f7be2c1e434d6c073 (patch) | |
| tree | 786b7c92f3d9abc6a147a59e440982306fc77f55 /crates/renderer/src/ffi/egl.rs | |
| parent | 4a22d2573cd4014c3cc0ed784dd2e9d6bed7fb67 (diff) | |
Update
Diffstat (limited to 'crates/renderer/src/ffi/egl.rs')
| -rw-r--r-- | crates/renderer/src/ffi/egl.rs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/crates/renderer/src/ffi/egl.rs b/crates/renderer/src/ffi/egl.rs new file mode 100644 index 0000000..33a39d4 --- /dev/null +++ b/crates/renderer/src/ffi/egl.rs @@ -0,0 +1,41 @@ +// from <EGL/egl.h> +pub const EGL_NONE: EGLenum = 0x3038; +pub const EGL_WIDTH: EGLenum = 0x3057; +pub const EGL_HEIGHT: EGLenum = 0x3056; + +// from <EGL/eglext.h> +pub const EGL_LINUX_DMA_BUF_EXT: EGLenum = 0x3270; +pub const EGL_LINUX_DRM_FOURCC_EXT: EGLenum = 0x3271; +pub const EGL_DMA_BUF_PLANE0_FD_EXT: EGLenum = 0x3272; +pub const EGL_DMA_BUF_PLANE0_OFFSET_EXT: EGLenum = 0x3273; +pub const EGL_DMA_BUF_PLANE0_PITCH_EXT: EGLenum = 0x3274; + +#[repr(C)] +pub struct EGLDisplayTarget(()); +pub type EGLDisplay = *mut EGLDisplayTarget; + +#[repr(C)] +pub struct EGLContextTarget(()); +pub type EGLContext = *mut EGLContextTarget; + +#[repr(C)] +pub struct EGLClientBufferTarget(()); +pub type EGLClientBuffer = *mut EGLClientBufferTarget; + +#[repr(C)] +pub struct EGLImageTarget(()); +pub type EGLImage = *mut EGLImageTarget; + +pub type EGLenum = core::ffi::c_uint; + +pub type EGLAttrib = libc::intptr_t; + +#[link(name = "EGL")] +extern "C" { + pub fn eglCreateImage(d: EGLDisplay, c: EGLContext, t: EGLenum, buf: EGLClientBuffer, attribs: *const EGLAttrib) -> EGLImage; +} + +#[link(name = "GL")] +extern "C" { + pub fn glEGLImageTargetTexture2DOES(t: u32, img: EGLImage); +} |
