Skip to content

Commit b398b97

Browse files
committed
fix(ffi): pass transparent=false to all surface_create_* calls
All platform variants of surface_create (Windows, Wayland, X11, Linux auto-detect) gained a `transparent: bool` parameter in processing_render but the FFI wrappers were not updated to match, causing a compile error. macOS was already correct. Pass `false` (opaque) to match existing behaviour.
1 parent f6a9c4b commit b398b97

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

Cargo.lock

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

crates/processing_ffi/src/lib.rs

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub extern "C" fn processing_surface_create(
6464
scale_factor: f32,
6565
) -> u64 {
6666
error::clear_error();
67-
error::check(|| surface_create_windows(window_handle, width, height, scale_factor))
67+
error::check(|| surface_create_windows(window_handle, width, height, scale_factor, false))
6868
.map(|e| e.to_bits())
6969
.unwrap_or(0)
7070
}
@@ -87,7 +87,7 @@ pub extern "C" fn processing_surface_create_wayland(
8787
) -> u64 {
8888
error::clear_error();
8989
error::check(|| {
90-
surface_create_wayland(window_handle, display_handle, width, height, scale_factor)
90+
surface_create_wayland(window_handle, display_handle, width, height, scale_factor, false)
9191
})
9292
.map(|e| e.to_bits())
9393
.unwrap_or(0)
@@ -110,7 +110,7 @@ pub extern "C" fn processing_surface_create_x11(
110110
scale_factor: f32,
111111
) -> u64 {
112112
error::clear_error();
113-
error::check(|| surface_create_x11(window_handle, display_handle, width, height, scale_factor))
113+
error::check(|| surface_create_x11(window_handle, display_handle, width, height, scale_factor, false))
114114
.map(|e| e.to_bits())
115115
.unwrap_or(0)
116116
}
@@ -133,7 +133,7 @@ pub extern "C" fn processing_surface_create(
133133
) -> u64 {
134134
error::clear_error();
135135
error::check(|| {
136-
surface_create_linux(window_handle, display_handle, width, height, scale_factor)
136+
surface_create_linux(window_handle, display_handle, width, height, scale_factor, false)
137137
})
138138
.map(|e| e.to_bits())
139139
.unwrap_or(0)
@@ -4436,3 +4436,23 @@ fn key_code_to_u32(kc: KeyCode) -> u32 {
44364436
_ => 0,
44374437
}
44384438
}
4439+
4440+
/// Tick the Bevy app one frame and poll GLFW events.
4441+
/// Call this once per frame from your external event loop, before begin_draw.
4442+
/// Returns true if the app should continue running, false if it should exit.
4443+
///
4444+
/// SAFETY:
4445+
/// - processing_init has been called.
4446+
/// - This is called from the same thread as init.
4447+
#[unsafe(no_mangle)]
4448+
pub extern "C" fn processing_poll_events() -> bool {
4449+
error::clear_error();
4450+
let result = processing_core::app_mut(|app| {
4451+
app.update();
4452+
Ok(())
4453+
});
4454+
match result {
4455+
Ok(_) => true,
4456+
Err(_) => false,
4457+
}
4458+
}

0 commit comments

Comments
 (0)