pub struct WlEglSurface { /* private fields */ }
Expand description

EGL surface

This object is a simple wrapper around a wl_surface 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 ObjectId::as_ptr() method on of the wl_display ID).

Implementations

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.

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.

Fetch current size of the EGL surface

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.

Raw pointer to the EGL surface

You’ll need this pointer to initialize the EGL context in your favourite OpenGL lib.

Trait Implementations

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
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
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
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more
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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.