rust-windowing / softbuffer

Easily write an image to a window
Apache License 2.0
333 stars 48 forks source link

Add support for iOS/tvOS/watchOS/visionOS #234

Closed madsmtm closed 2 months ago

madsmtm commented 2 months ago

A general clean-up of the CoreGraphics implementation, instead of creating a new NSView and rendering into the layer there, we create a sublayer. See the code comments, and also https://github.com/gfx-rs/wgpu/pull/6107 for some of the design decisions around this.

This is also a step forwards for making softbuffer usable from a separate thread on Apple platforms, as CALayer is fully thread safe (whereas NSView/UIView aren't).

Finally, it removes our dependence on having access to NSView, paving the way for a future where raw-window-handle may only provide CALayer.

Fixes https://github.com/rust-windowing/softbuffer/issues/43.