(path_ptr: *const u8)
| 798 | |
| 799 | #[no_mangle] |
| 800 | pub extern "C" fn bloom_load_texture(path_ptr: *const u8) -> f64 { |
| 801 | let path = str_from_header(path_ptr); |
| 802 | match std::fs::read(path) { |
| 803 | Ok(data) => { |
| 804 | let eng = engine(); |
| 805 | let renderer_ptr = &mut eng.renderer as *mut bloom_shared::renderer::Renderer; |
| 806 | eng.textures.load_texture(unsafe { &mut *renderer_ptr }, &data) |
| 807 | } |
| 808 | Err(_) => 0.0, |
| 809 | } |
| 810 | } |
| 811 | |
| 812 | #[no_mangle] |
| 813 | pub extern "C" fn bloom_unload_texture(handle: f64) { |
nothing calls this directly
no test coverage detected