Struct wayland_egl::WlEglSurface
source · [−]pub struct WlEglSurface { /* private fields */ }
Expand description
EGL surface
This object is a simple wrapper around a WlSurface
to add the EGL
capabilities. Just use the ptr
method once this object is created
to get the window pointer your OpenGL library is needing to initialize the
EGL context (you’ll most likely need the display ptr as well, that you can
get via the ptr
method of the Proxy
trait on the WlDisplay
object).
Implementations
sourceimpl WlEglSurface
impl WlEglSurface
sourcepub fn new(
surface: ObjectId,
width: i32,
height: i32
) -> Result<WlEglSurface, Error>
pub fn new(
surface: ObjectId,
width: i32,
height: i32
) -> Result<WlEglSurface, Error>
Create an EGL surface from a wayland surface
This method will check that the provided ObjectId
is still alive and from the
correct interface (wl_surface
).
You must always destroy the WlEglSurface
before the underling wl_surface
protocol object.
sourcepub unsafe fn new_from_raw(
surface: *mut wl_proxy,
width: i32,
height: i32
) -> Result<WlEglSurface, Error>
pub unsafe fn new_from_raw(
surface: *mut wl_proxy,
width: i32,
height: i32
) -> Result<WlEglSurface, Error>
Create an EGL surface from a raw pointer to a wayland surface.
Safety
The provided pointer must be a valid wl_surface
pointer from libwayland-client
.
sourcepub fn resize(&self, width: i32, height: i32, dx: i32, dy: i32)
pub fn resize(&self, width: i32, height: i32, dx: i32, dy: i32)
Resize the EGL surface
The two first arguments (width, height)
are the new size of
the surface, the two others (dx, dy)
represent the displacement
of the top-left corner of the surface. It allows you to control the
direction of the resizing if necessary.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for WlEglSurface
impl !Sync for WlEglSurface
impl Unpin for WlEglSurface
impl UnwindSafe for WlEglSurface
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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
. Read more
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
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. Read more
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. Read more