From d943ba194b3cfab18354e96f7be2c1e434d6c073 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Sun, 26 Apr 2026 22:56:52 -0400 Subject: Update --- crates/renderer/src/ffi/egl.rs | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 crates/renderer/src/ffi/egl.rs (limited to 'crates/renderer/src/ffi/egl.rs') 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 +pub const EGL_NONE: EGLenum = 0x3038; +pub const EGL_WIDTH: EGLenum = 0x3057; +pub const EGL_HEIGHT: EGLenum = 0x3056; + +// from +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); +} -- cgit v1.2.3