Skip to content

Commit

Permalink
metal: expose the CAMetalLayer
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Feb 11, 2024
1 parent c4f951a commit 0dd584a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions blade-graphics/src/metal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,14 @@ impl Context {
},
}
}

/// Get the CALayerMetal for this surface, if any.
/// This is platform specific API.
pub fn metal_layer(&self) -> Option<metal::MetalLayer> {
self.surface
.as_ref()
.map(|suf| suf.lock().unwrap().render_layer.clone())
}
}

#[hidden_trait::expose]
Expand Down

0 comments on commit 0dd584a

Please sign in to comment.