1
0
Fork 0
forked from wry/wry
wry/src/gfx_apis/gl/egl/image.rs
2025-02-21 10:44:29 +01:00

27 lines
573 B
Rust

use {
crate::{
gfx_apis::gl::egl::{
display::EglDisplay,
sys::{EGL_FALSE, EGLImageKHR},
},
video::dmabuf::DmaBuf,
},
std::rc::Rc,
};
pub struct EglImage {
pub dpy: Rc<EglDisplay>,
pub img: EGLImageKHR,
pub external_only: bool,
pub dmabuf: DmaBuf,
}
impl Drop for EglImage {
fn drop(&mut self) {
unsafe {
if self.dpy.procs.eglDestroyImageKHR(self.dpy.dpy, self.img) == EGL_FALSE {
log::warn!("`eglDestroyImageKHR` failed");
}
}
}
}