Skip to content

Commit c91dc85

Browse files
Ralph Kuepperclaude
andcommitted
Add 3D engine stubs for Windows native layer
The Windows native layer was missing 40 extern "C" functions for the 3D scene graph, lighting, shadows, and picking subsystems. These are implemented on macOS but not yet on Windows. Without them, linking fails when the Bloom TypeScript wrappers reference them. Added no-op stubs so 2D games (like Bloom Jump) can compile and run on Windows. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 12951ab commit c91dc85

2 files changed

Lines changed: 68 additions & 0 deletions

File tree

native/windows/Cargo.lock

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

native/windows/src/lib.rs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,3 +1178,45 @@ fn pollster_block_on<F: std::future::Future>(future: F) -> F::Output {
11781178
}
11791179
}
11801180
}
1181+
1182+
// 3D engine stubs — not yet implemented on Windows
1183+
#[no_mangle] pub extern "C" fn bloom_register_frame_callback(_priority: f64, _callback: extern "C" fn(f64)) -> f64 { 0.0 }
1184+
#[no_mangle] pub extern "C" fn bloom_unregister_frame_callback(_id: f64) {}
1185+
#[no_mangle] pub extern "C" fn bloom_add_directional_light(_dx: f64, _dy: f64, _dz: f64, _r: f64, _g: f64, _b: f64, _intensity: f64) {}
1186+
#[no_mangle] pub extern "C" fn bloom_add_point_light(_x: f64, _y: f64, _z: f64, _range: f64, _r: f64, _g: f64, _b: f64, _intensity: f64) {}
1187+
#[no_mangle] pub extern "C" fn bloom_scene_create_node() -> f64 { 0.0 }
1188+
#[no_mangle] pub extern "C" fn bloom_scene_destroy_node(_handle: f64) {}
1189+
#[no_mangle] pub extern "C" fn bloom_scene_set_visible(_handle: f64, _visible: f64) {}
1190+
#[no_mangle] pub extern "C" fn bloom_scene_set_cast_shadow(_handle: f64, _cast: f64) {}
1191+
#[no_mangle] pub extern "C" fn bloom_scene_set_receive_shadow(_handle: f64, _receive: f64) {}
1192+
#[no_mangle] pub extern "C" fn bloom_scene_set_parent(_handle: f64, _parent: f64) {}
1193+
#[no_mangle] pub extern "C" fn bloom_scene_set_transform(_handle: f64, _mat_ptr: *const f64) {}
1194+
#[no_mangle] pub extern "C" fn bloom_scene_update_geometry(_handle: f64, _vert_ptr: *const f64, _vert_count: f64, _idx_ptr: *const f64, _idx_count: f64) {}
1195+
#[no_mangle] pub extern "C" fn bloom_scene_set_material_color(_handle: f64, _r: f64, _g: f64, _b: f64, _a: f64) {}
1196+
#[no_mangle] pub extern "C" fn bloom_scene_set_material_pbr(_handle: f64, _roughness: f64, _metalness: f64) {}
1197+
#[no_mangle] pub extern "C" fn bloom_scene_set_material_texture(_handle: f64, _texture_idx: f64) {}
1198+
#[no_mangle] pub extern "C" fn bloom_scene_node_count() -> f64 { 0.0 }
1199+
#[no_mangle] pub extern "C" fn bloom_scene_node_vertex_count(_handle: f64) -> f64 { 0.0 }
1200+
#[no_mangle] pub extern "C" fn bloom_scene_node_index_count(_handle: f64) -> f64 { 0.0 }
1201+
#[no_mangle] pub extern "C" fn bloom_scene_extrude_polygon(_handle: f64, _polygon_ptr: *const f64, _polygon_count: f64, _depth: f64) {}
1202+
#[no_mangle] pub extern "C" fn bloom_scene_subtract_box(_handle: f64, _min_x: f64, _min_y: f64, _min_z: f64, _max_x: f64, _max_y: f64, _max_z: f64) {}
1203+
#[no_mangle] pub extern "C" fn bloom_enable_shadows() {}
1204+
#[no_mangle] pub extern "C" fn bloom_disable_shadows() {}
1205+
#[no_mangle] pub extern "C" fn bloom_enable_postfx() {}
1206+
#[no_mangle] pub extern "C" fn bloom_disable_postfx() {}
1207+
#[no_mangle] pub extern "C" fn bloom_postfx_set_selected(_handle: f64) {}
1208+
#[no_mangle] pub extern "C" fn bloom_postfx_set_hovered(_handle: f64) {}
1209+
#[no_mangle] pub extern "C" fn bloom_postfx_set_outline_color(_r: f64, _g: f64, _b: f64, _a: f64) {}
1210+
#[no_mangle] pub extern "C" fn bloom_postfx_set_outline_thickness(_thickness: f64) {}
1211+
#[no_mangle] pub extern "C" fn bloom_project_to_screen(_wx: f64, _wy: f64, _wz: f64) -> f64 { 0.0 }
1212+
#[no_mangle] pub extern "C" fn bloom_project_screen_y() -> f64 { 0.0 }
1213+
#[no_mangle] pub extern "C" fn bloom_scene_attach_model(_node_handle: f64, _model_handle: f64, _mesh_index: f64) {}
1214+
#[no_mangle] pub extern "C" fn bloom_scene_pick(_screen_x: f64, _screen_y: f64) -> f64 { 0.0 }
1215+
#[no_mangle] pub extern "C" fn bloom_pick_hit_handle() -> f64 { 0.0 }
1216+
#[no_mangle] pub extern "C" fn bloom_pick_hit_distance() -> f64 { 0.0 }
1217+
#[no_mangle] pub extern "C" fn bloom_pick_hit_x() -> f64 { 0.0 }
1218+
#[no_mangle] pub extern "C" fn bloom_pick_hit_y() -> f64 { 0.0 }
1219+
#[no_mangle] pub extern "C" fn bloom_pick_hit_z() -> f64 { 0.0 }
1220+
#[no_mangle] pub extern "C" fn bloom_pick_hit_normal_x() -> f64 { 0.0 }
1221+
#[no_mangle] pub extern "C" fn bloom_pick_hit_normal_y() -> f64 { 0.0 }
1222+
#[no_mangle] pub extern "C" fn bloom_pick_hit_normal_z() -> f64 { 0.0 }

0 commit comments

Comments
 (0)