pub struct Gpu { /* private fields */ }Available on crate feature
toolkit only.Expand description
EGL/GL state bound to a wl_surface, created once the surface has its first
size. Owns the egui_glow painter and the dma-buf texture cache.
Implementations§
Source§impl Gpu
impl Gpu
Sourcepub fn new(conn: &Connection, surface: &WlSurface, pw: i32, ph: i32) -> Gpu
pub fn new(conn: &Connection, surface: &WlSurface, pw: i32, ph: i32) -> Gpu
Build the EGL/GLES context for surface at physical size pw×ph.
Panics on EGL setup failure (the host can’t render without it).
Sourcepub fn resize(&self, pw: i32, ph: i32)
pub fn resize(&self, pw: i32, ph: i32)
Resize the EGL window to a new physical size (after a surface configure / scale change).
Sourcepub fn render(
&mut self,
egui_ctx: &Context,
raw_input: RawInput,
ppp: f32,
size_px: (u32, u32),
backdrop: [f32; 4],
run_ui: impl FnMut(&mut Ui, &mut dyn DmabufImporter),
)
pub fn render( &mut self, egui_ctx: &Context, raw_input: RawInput, ppp: f32, size_px: (u32, u32), backdrop: [f32; 4], run_ui: impl FnMut(&mut Ui, &mut dyn DmabufImporter), )
Run one egui frame and present it. run_ui builds the UI; it is handed the
dma-buf importer (this owns the GL context) so capture frames become
drawable textures. backdrop is the GL clear colour (premultiplied gamma).
Auto Trait Implementations§
impl !Send for Gpu
impl !Sync for Gpu
impl Freeze for Gpu
impl RefUnwindSafe for Gpu
impl Unpin for Gpu
impl UnsafeUnpin for Gpu
impl UnwindSafe for Gpu
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.