(path_ptr: *const u8)
| 945 | |
| 946 | #[no_mangle] |
| 947 | pub extern "C" fn bloom_load_texture(path_ptr: *const u8) -> f64 { |
| 948 | let path = str_from_header(path_ptr); |
| 949 | match std::fs::read(path) { |
| 950 | Ok(data) => { |
| 951 | let eng = engine(); |
| 952 | let renderer_ptr = &mut eng.renderer as *mut bloom_shared::renderer::Renderer; |
| 953 | eng.textures.load_texture(unsafe { &mut *renderer_ptr }, &data) |
| 954 | } |
| 955 | Err(_) => 0.0, |
| 956 | } |
| 957 | } |
| 958 | |
| 959 | #[no_mangle] |
| 960 | pub extern "C" fn bloom_unload_texture(handle: f64) { |
nothing calls this directly
no test coverage detected