(width: f64, height: f64)
| 3370 | // Q1: Render texture FFI — create GPU textures for render-to-texture. |
| 3371 | #[no_mangle] |
| 3372 | pub extern "C" fn bloom_load_render_texture(width: f64, height: f64) -> f64 { |
| 3373 | let w = width as u32; |
| 3374 | let h = height as u32; |
| 3375 | let eng = engine(); |
| 3376 | let rt_handle = eng.textures.load_render_texture(w, h); |
| 3377 | |
| 3378 | // Create the GPU texture via the renderer's public method. |
| 3379 | let (bind_group_idx, _tex_vec_idx) = eng.renderer.create_render_texture(w, h); |
| 3380 | |
| 3381 | // Register as a texture handle so drawTexture can sample it. |
| 3382 | let tex_handle = eng.textures.textures.alloc(bloom_shared::textures::TextureData { |
| 3383 | bind_group_idx, width: w, height: h, |
| 3384 | }); |
| 3385 | eng.textures.set_render_texture_handle(rt_handle, tex_handle); |
| 3386 | |
| 3387 | rt_handle |
| 3388 | } |
| 3389 | |
| 3390 | #[no_mangle] |
| 3391 | pub extern "C" fn bloom_unload_render_texture(handle: f64) { |
nothing calls this directly
no test coverage detected