Skip to content

Commit

Permalink
Redo layer creation to create a sub layer if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Sep 4, 2024
1 parent f6bf653 commit 831e133
Show file tree
Hide file tree
Showing 7 changed files with 567 additions and 168 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
- Make `Layer`'s implementation details private; it is now a struct with `as_ptr` and `is_existing` accessor methods.
- Add support for tvOS, watchOS and visionOS.
- Use `objc2` internally.
- Move `Layer` constructors to the type itself.
- `appkit::metal_layer_from_ns_view` is now `Layer::from_ns_view`.
- `uikit::metal_layer_from_ui_view` is now `Layer::from_ui_view`.
- Added `Layer::from_layer` to construct a `Layer` from a `CALayer` directly.
- Fixed layers not automatically resizing to match the super layer they were created from.

# 0.4.0 (2023-10-31)
- Update `raw-window-handle` dep to `0.6.0`.
Expand Down
33 changes: 13 additions & 20 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
name = "raw-window-metal"
version = "0.4.0"
license = "MIT OR Apache-2.0"
authors = ["The Gfx-rs Developers"]
edition = "2021"
description = "Interop library between Metal and raw-window-handle"
documentation = "https://docs.rs/raw-window-metal"
Expand All @@ -12,37 +11,31 @@ keywords = ["window", "metal", "graphics"]
categories = ["game-engines", "graphics"]
exclude = [".github/*"]

[dependencies]
raw-window-handle = "0.6.0"

[target.'cfg(target_vendor = "apple")'.dependencies]
objc2 = "0.5.2"
objc2-foundation = { version = "0.2.2", features = [
"NSObjCRuntime",
"NSDictionary",
"NSGeometry",
"NSKeyValueObserving",
"NSObjCRuntime",
"NSString",
"NSThread",
"NSValue",
] }
objc2-quartz-core = { version = "0.2.2", features = [
"CALayer",
"CAMetalLayer",
"objc2-metal",
] }

[target.'cfg(target_os = "macos")'.dependencies]
objc2-app-kit = { version = "0.2.2", features = [
"NSResponder",
"NSView",
"NSWindow",
"objc2-quartz-core",
] }
[dev-dependencies]
raw-window-handle = "0.6.0"

[target.'cfg(all(target_vendor = "apple", not(target_os = "macos")))'.dependencies]
objc2-ui-kit = { version = "0.2.2", features = [
"UIResponder",
"UIView",
"UIWindow",
"UIScreen",
"objc2-quartz-core",
] }
[target.'cfg(target_os = "macos")'.dev-dependencies]
objc2-app-kit = { version = "0.2.2", features = ["NSResponder", "NSView"] }

[target.'cfg(all(target_vendor = "apple", not(target_os = "macos")))'.dev-dependencies]
objc2-ui-kit = { version = "0.2.2", features = ["UIResponder", "UIView"] }

[package.metadata.docs.rs]
targets = [
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ raw-window-metal = "0.4"
`CAMetalLayer` is the common entrypoint for graphics APIs (e.g `gfx` or `MoltenVK`), but the handles provided by window libraries may not include such a layer.
This library may extract either this layer or allocate a new one.

Code is mostly extracted from the `gfx-backend-metal` crate.

## License

Licensed under either of
Expand Down
70 changes: 0 additions & 70 deletions src/appkit.rs

This file was deleted.

Loading

0 comments on commit 831e133

Please sign in to comment.