Struct glutin::api::egl::display::Display

source ·
pub struct Display { /* private fields */ }
Available on egl_backend only.
Expand description

A wrapper for the EGLDisplay and its supported extensions.

Implementations§

source§

impl Display

source

pub unsafe fn new(raw_display: RawDisplayHandle) -> Result<Self>

Create EGL display with the native display.

§Safety

raw_display must point to a valid system display. Using zero or std::ptr::null() for the display will result in using EGL_DEFAULT_DISPLAY, which is not recommended or will work on a platform with a concept of native display, like Wayland.

source

pub unsafe fn with_device( device: &Device, raw_display: Option<RawDisplayHandle>, ) -> Result<Self>

Create an EGL display using the specified device.

In most cases, prefer Display::new() unless you need to render off screen or use other extensions like EGLStreams.

This function may take an optional RawDisplayHandle argument. At the moment the raw_display argument is ignored and this function will return Err. This may change in the future.

§Safety

If raw_display is Some, raw_display must point to a valid system display.

source

pub fn device(&self) -> Result<Device>

Get the Device the display is using.

This function returns Err if the EGL_EXT_device_query or EGL_EXT_device_base extensions are not available.

source

pub fn egl(&self) -> &'static Egl

Get a reference to the initialized EGL API.

source

pub unsafe fn terminate(self)

Terminate the EGL display.

When the display is managed by glutin with the EGL_KHR_display_reference this function does nothing and eglTerminate will be automatically invoked during display destruction.

§Safety

This function will destroy the global EGL state, even the one created and managed by other libraries. Use this function only when you’re bringing everything down.

Trait Implementations§

source§

impl AsRawDisplay for Display

source§

fn raw_display(&self) -> RawDisplay

A raw handle to the underlying Api display.
source§

impl Clone for Display

source§

fn clone(&self) -> Display

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Display

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl GetDisplayExtensions for Display

source§

fn extensions(&self) -> &HashSet<&'static str>

Supported extensions by the display. Read more
source§

impl GlDisplay for Display

§

type Config = Config

A config that is used by the display.
§

type NotCurrentContext = NotCurrentContext

A context that is being used by the display.
§

type PbufferSurface = Surface<PbufferSurface>

A pbuffer surface created by the display.
§

type PixmapSurface = Surface<PixmapSurface>

A pixmap surface created by the display.
§

type WindowSurface = Surface<WindowSurface>

A window surface created by the display.
source§

unsafe fn find_configs( &self, template: ConfigTemplate, ) -> Result<Box<dyn Iterator<Item = Self::Config> + '_>>

Find configurations matching the given template. Read more
source§

unsafe fn create_window_surface( &self, config: &Self::Config, surface_attributes: &SurfaceAttributes<WindowSurface>, ) -> Result<Self::WindowSurface>

Create the surface that can be used to render into native window. Read more
source§

unsafe fn create_pbuffer_surface( &self, config: &Self::Config, surface_attributes: &SurfaceAttributes<PbufferSurface>, ) -> Result<Self::PbufferSurface>

Create the surface that can be used to render into pbuffer. Read more
source§

unsafe fn create_context( &self, config: &Self::Config, context_attributes: &ContextAttributes, ) -> Result<Self::NotCurrentContext>

Create the graphics platform context. Read more
source§

unsafe fn create_pixmap_surface( &self, config: &Self::Config, surface_attributes: &SurfaceAttributes<PixmapSurface>, ) -> Result<Self::PixmapSurface>

Create the surface that can be used to render into pixmap. Read more
source§

fn get_proc_address(&self, addr: &CStr) -> *const c_void

Return the address of an OpenGL function. Read more
source§

fn version_string(&self) -> String

Helper to obtain the information about the underlying display. Read more
source§

fn supported_features(&self) -> DisplayFeatures

Get the features supported by the display. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.