wgpu/documentation/platforms/android.rs
1/*!
2# Running on Android
3
4## Surface creation
5
6On Android, surface creation should happen on the resume event of the
7window, and surface cleanup on the suspend event. A valid surface cannot be
8created beforehand. This means that, when using `winit`, `sdl2`, or anything
9similar, surface creation should happen in the resume handler, roughly like
10this:
11
12```ignore
13// winit's `ApplicationHandler::resumed`:
14fn resumed(&mut self, event_loop: &ActiveEventLoop) {
15 let window = event_loop.create_window(Window::default_attributes()).unwrap();
16 let surface = instance.create_surface(window).unwrap();
17 // ...
18}
19```
20
21Correspondingly, drop the [`Surface`] when the window is suspended.
22*/
23
24use crate::Surface;