[][src]Struct wayland_egl::WlEglSurface

pub struct WlEglSurface { /* fields omitted */ }

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

impl WlEglSurface[src]

pub fn new(surface: &WlSurface, width: i32, height: i32) -> WlEglSurface[src]

Create an EGL surface from a wayland surface

pub unsafe fn new_from_raw(
    surface: *mut wl_proxy,
    width: i32,
    height: i32
) -> WlEglSurface
[src]

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.

pub fn get_size(&self) -> (i32, i32)[src]

Fetch current size of the EGL surface

pub fn resize(&self, width: i32, height: i32, dx: i32, dy: i32)[src]

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.

pub fn ptr(&self) -> *const c_void[src]

Raw pointer to the EGL surface

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

Trait Implementations

impl Drop for WlEglSurface[src]

impl Send for WlEglSurface[src]

impl Sync for WlEglSurface[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.