pub enum Display {
Egl(Display),
Glx(Display),
}
Expand description
The graphics display to handle underlying graphics platform in a cross-platform way.
The display can be accessed from any thread.
fn test_send<T: Send>() {}
fn test_sync<T: Sync>() {}
test_send::<glutin::display::Display>();
test_sync::<glutin::display::Display>();
Variants§
Implementations§
Source§impl Display
impl Display
Sourcepub unsafe fn new(
display: RawDisplayHandle,
preference: DisplayApiPreference,
) -> Result<Self>
pub unsafe fn new( display: RawDisplayHandle, preference: DisplayApiPreference, ) -> Result<Self>
Create a graphics platform display from the given raw display handle.
The display mixing isn’t supported, so if you created EGL display you can’t use it with the GLX display objects. Interaction between those will result in a runtime panic.
§Safety
The display
must point to the valid platform display and be valid for
the entire lifetime of all Objects created with that display.
The preference
must contain pointers to the valid values if GLX or WGL
specific options were used.
Trait Implementations§
Source§impl AsRawDisplay for Display
impl AsRawDisplay for Display
Source§fn raw_display(&self) -> RawDisplay
fn raw_display(&self) -> RawDisplay
A raw handle to the underlying Api display.
Source§impl GlDisplay for Display
impl GlDisplay for Display
Source§type NotCurrentContext = NotCurrentContext
type NotCurrentContext = NotCurrentContext
A context that is being used by the display.
Source§type PbufferSurface = Surface<PbufferSurface>
type PbufferSurface = Surface<PbufferSurface>
A pbuffer surface created by the display.
Source§type PixmapSurface = Surface<PixmapSurface>
type PixmapSurface = Surface<PixmapSurface>
A pixmap surface created by the display.
Source§type WindowSurface = Surface<WindowSurface>
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> + '_>>
unsafe fn find_configs( &self, template: ConfigTemplate, ) -> Result<Box<dyn Iterator<Item = Self::Config> + '_>>
Find configurations matching the given
template
. Read moreSource§unsafe fn create_context(
&self,
config: &Self::Config,
context_attributes: &ContextAttributes,
) -> Result<Self::NotCurrentContext>
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_window_surface(
&self,
config: &Self::Config,
surface_attributes: &SurfaceAttributes<WindowSurface>,
) -> Result<Self::WindowSurface>
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>
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_pixmap_surface(
&self,
config: &Self::Config,
surface_attributes: &SurfaceAttributes<PixmapSurface>,
) -> Result<Self::PixmapSurface>
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
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
fn version_string(&self) -> String
Helper to obtain the information about the underlying display. Read more
Source§fn supported_features(&self) -> DisplayFeatures
fn supported_features(&self) -> DisplayFeatures
Get the features supported by the display. Read more
Auto Trait Implementations§
impl Freeze for Display
impl RefUnwindSafe for Display
impl Send for Display
impl Sync for Display
impl Unpin for Display
impl UnwindSafe for Display
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more