pub struct MetalLayer { /* private fields */ }Expand description
A CAMetalLayer for rendering to a window
Implementations§
Source§impl MetalLayer
impl MetalLayer
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new Metal layer
§Panics
Panics if layer creation fails (should not happen on macOS with Metal support).
Sourcepub fn set_device(&self, device: &MetalDevice)
pub fn set_device(&self, device: &MetalDevice)
Set the device for this layer
Sourcepub fn set_pixel_format(&self, format: MTLPixelFormat)
pub fn set_pixel_format(&self, format: MTLPixelFormat)
Set the pixel format
Sourcepub fn set_drawable_size(&self, width: f64, height: f64)
pub fn set_drawable_size(&self, width: f64, height: f64)
Set the drawable size
Sourcepub fn set_presents_with_transaction(&self, value: bool)
pub fn set_presents_with_transaction(&self, value: bool)
Set whether to present with transaction
Sourcepub fn next_drawable(&self) -> Option<MetalDrawable>
pub fn next_drawable(&self) -> Option<MetalDrawable>
Get the next drawable
Trait Implementations§
Source§impl Debug for MetalLayer
impl Debug for MetalLayer
Source§impl Default for MetalLayer
impl Default for MetalLayer
Auto Trait Implementations§
impl Freeze for MetalLayer
impl RefUnwindSafe for MetalLayer
impl !Send for MetalLayer
impl !Sync for MetalLayer
impl Unpin for MetalLayer
impl UnwindSafe for MetalLayer
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