MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / bloom_load_render_texture

Function bloom_load_render_texture

native/macos/src/lib.rs:2640–2656  ·  view source on GitHub ↗
(width: f64, height: f64)

Source from the content-addressed store, hash-verified

2638// Q1: Render texture FFI — create GPU textures for render-to-texture.
2639#[no_mangle]
2640pub 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]
2658pub extern "C" fn bloom_unload_render_texture(handle: f64) {
2659 engine().textures.unload_render_texture(handle);

Callers

nothing calls this directly

Calls 5

load_render_textureMethod · 0.80
create_render_textureMethod · 0.80
allocMethod · 0.80
engineFunction · 0.70

Tested by

no test coverage detected