(width: f64, height: f64)
| 2668 | |
| 2669 | #[no_mangle] |
| 2670 | pub extern "C" fn bloom_load_render_texture(width: f64, height: f64) -> f64 { |
| 2671 | let w = width as u32; |
| 2672 | let h = height as u32; |
| 2673 | let eng = engine(); |
| 2674 | let rt_handle = eng.textures.load_render_texture(w, h); |
| 2675 | |
| 2676 | // Create the GPU texture via the renderer's public method. |
| 2677 | let (bind_group_idx, _tex_vec_idx) = eng.renderer.create_render_texture(w, h); |
| 2678 | |
| 2679 | // Register as a texture handle so drawTexture can sample it. |
| 2680 | let tex_handle = eng.textures.textures.alloc(bloom_shared::textures::TextureData { |
| 2681 | bind_group_idx, width: w, height: h, |
| 2682 | }); |
| 2683 | eng.textures.set_render_texture_handle(rt_handle, tex_handle); |
| 2684 | |
| 2685 | rt_handle |
| 2686 | } |
| 2687 | |
| 2688 | #[no_mangle] |
| 2689 | pub extern "C" fn bloom_unload_render_texture(handle: f64) { |
no test coverage detected