pub struct Display { /* private fields */ }
Expand description
A wrapper for the EGLDisplay
and its supported extensions.
Implementations§
Source§impl Display
impl Display
Sourcepub unsafe fn new(raw_display: RawDisplayHandle) -> Result<Self>
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.
Sourcepub unsafe fn with_device(
device: &Device,
raw_display: Option<RawDisplayHandle>,
) -> Result<Self>
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
RawDisplayHandle::Drm
. The provided
[raw_display_handle::DrmDisplayHandle.fd
] may be closed after calling
this function.
Sourcepub unsafe fn terminate(self)
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
impl AsRawDisplay for Display
Source§fn raw_display(&self) -> RawDisplay
fn raw_display(&self) -> RawDisplay
Source§impl GetDisplayExtensions for Display
impl GetDisplayExtensions for Display
Source§impl GlDisplay for Display
impl GlDisplay for Display
Source§type NotCurrentContext = NotCurrentContext
type NotCurrentContext = NotCurrentContext
Source§type PbufferSurface = Surface<PbufferSurface>
type PbufferSurface = Surface<PbufferSurface>
Source§type PixmapSurface = Surface<PixmapSurface>
type PixmapSurface = Surface<PixmapSurface>
Source§type WindowSurface = Surface<WindowSurface>
type WindowSurface = Surface<WindowSurface>
Source§unsafe fn find_configs(
&self,
template: ConfigTemplate,
) -> Result<Box<dyn Iterator<Item = Self::Config> + '_>>
unsafe fn find_configs( &self, template: ConfigTemplate, ) -> Result<Box<dyn Iterator<Item = Self::Config> + '_>>
template
. Read more