wgpu/documentation/platforms/mobile_app_integration.rs
1/*!
2# Integrating wgpu into Existing iOS and Android Apps
3
4`wgpu` does not depend on any windowing library, so it does not provide
5window creation and management functions. Only when creating a window-based
6[`Surface`] may an argument that implements the
7[`raw-window-handle`](https://github.com/rust-windowing/raw-window-handle)
8abstract interface be required. The
9[`winit`](https://github.com/rust-windowing/winit) crate used by the `wgpu`
10examples is a cross-platform window creation and management crate that
11implements that interface; it takes over the window management and event
12loop of the entire app.
13
14There is no doubt that, for game apps, the combination of `wgpu` + `winit`
15is very suitable. However, a large number of non-game apps also often need
16to use graphics APIs (for charts, image filters, etc.). These apps need to
17use a lot of system UI components and interactions, and `winit`'s way of
18taking over the entire app window is not suitable. So, it would be very
19useful to integrate `wgpu` into existing iOS and Android apps without using
20third-party window-management libraries.
21
22[wgpu-in-app](https://github.com/jinleili/wgpu-in-app) is a complete doc and
23example of how to do it. The doc section also has two Chinese versions:
24[与 iOS App 集成](https://jinleili.github.io/learn-wgpu-zh/integration-and-debugging/ios/)
25and
26[与 Android App 集成](https://jinleili.github.io/learn-wgpu-zh/integration-and-debugging/android/).
27*/
28
29use crate::Surface;