()
| 300 | |
| 301 | #[no_mangle] |
| 302 | pub extern "C" fn bloom_end_drawing() { |
| 303 | let result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { |
| 304 | engine().end_frame(); |
| 305 | })); |
| 306 | if let Err(e) = result { |
| 307 | let msg = if let Some(s) = e.downcast_ref::<&str>() { |
| 308 | s.to_string() |
| 309 | } else if let Some(s) = e.downcast_ref::<String>() { |
| 310 | s.clone() |
| 311 | } else { |
| 312 | format!("unknown panic: {:?}", e.type_id()) |
| 313 | }; |
| 314 | // Write to file since eprintln doesn't reach logcat on Android |
| 315 | static mut LOGGED: bool = false; |
| 316 | unsafe { |
| 317 | if !LOGGED { |
| 318 | LOGGED = true; |
| 319 | let path = resolve_path("bloom_panic.txt"); |
| 320 | let _ = std::fs::write(&path, format!("end_drawing panic: {}\n", msg)); |
| 321 | } |
| 322 | } |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | // ============================================================ |
| 327 | // Audio (Oboe / AAudio) |
nothing calls this directly
no test coverage detected