(width: f64, height: f64)
| 2638 | // Q1: Render texture FFI — create GPU textures for render-to-texture. |
| 2639 | #[no_mangle] |
| 2640 | pub extern "C" fn bloom_load_render_texture(width: f64, height: f64) -> f64 { |
| 2641 | let w = width as u32; |
| 2642 | let h = height as u32; |
| 2643 | let eng = engine(); |
| 2644 | let rt_handle = eng.textures.load_render_texture(w, h); |
| 2645 | |
| 2646 | // Create the GPU texture via the renderer's public method. |
| 2647 | let (bind_group_idx, _tex_vec_idx) = eng.renderer.create_render_texture(w, h); |
| 2648 | |
| 2649 | // Register as a texture handle so drawTexture can sample it. |
| 2650 | let tex_handle = eng.textures.textures.alloc(bloom_shared::textures::TextureData { |
| 2651 | bind_group_idx, width: w, height: h, |
| 2652 | }); |
| 2653 | eng.textures.set_render_texture_handle(rt_handle, tex_handle); |
| 2654 | |
| 2655 | rt_handle |
| 2656 | } |
| 2657 | #[no_mangle] |
| 2658 | pub extern "C" fn bloom_unload_render_texture(handle: f64) { |
| 2659 | engine().textures.unload_render_texture(handle); |
nothing calls this directly
no test coverage detected