Skip to content

Commit

Permalink
Better document pre_existing (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm authored Sep 9, 2024
1 parent 820f241 commit 10f5284
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,14 @@ impl Layer {
ptr as *mut _
}

/// Whether `raw-window-metal` created a new [`CAMetalLayer`] for you.
/// If `raw-window-metal` created a new [`CAMetalLayer`] for you, this returns `false`.
///
/// This may be useful if you want to override some part of `raw-window-metal`'s behaviour, and
/// need to do so based on whether it ended up creating a layer or not.
///
/// You should try to avoid this, and instead:
/// - Modify `CALayer` properties on the layer that you created this from.
/// - Modify `CAMetalLayer` properties on the layer returned from `as_ptr`.
#[inline]
pub fn pre_existing(&self) -> bool {
self.pre_existing
Expand Down

0 comments on commit 10f5284

Please sign in to comment.