(path_ptr: *const u8)
| 561 | |
| 562 | #[no_mangle] |
| 563 | pub extern "C" fn bloom_load_texture(path_ptr: *const u8) -> f64 { |
| 564 | let path = str_from_header(path_ptr); |
| 565 | match std::fs::read(resolve_path(path)) { |
| 566 | Ok(data) => { |
| 567 | let eng = engine(); |
| 568 | let renderer_ptr = &mut eng.renderer as *mut bloom_shared::renderer::Renderer; |
| 569 | eng.textures.load_texture(unsafe { &mut *renderer_ptr }, &data) |
| 570 | } |
| 571 | Err(_) => 0.0, |
| 572 | } |
| 573 | } |
| 574 | |
| 575 | #[no_mangle] |
| 576 | pub extern "C" fn bloom_unload_texture(handle: f64) { |
nothing calls this directly
no test coverage detected