(&mut self, new_size: WindowSize)
| 210 | /// Resize the window. |
| 211 | #[cfg(all(not(feature = "headless"), feature = "window"))] |
| 212 | pub(crate) fn resize(&mut self, new_size: WindowSize) { |
| 213 | // check if new_size is non-zero |
| 214 | if new_size.0 != 0 && new_size.1 != 0 { |
| 215 | self.size = new_size; |
| 216 | self.config.width = new_size.0; |
| 217 | self.config.height = new_size.1; |
| 218 | #[cfg(not(target_os = "android"))] |
| 219 | if let Some(surface) = self.surface.as_ref() { |
| 220 | surface.configure(&self.device, &self.config); |
| 221 | self.depth_buffer = |
| 222 | Self::build_depth_buffer("Depth Buffer", &self.device, &self.config); |
| 223 | } |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | /// Render the scene. Returns the command encoder, the texture view, and the surface texture. |
| 228 | pub(crate) fn pre_render( |
no outgoing calls
no test coverage detected