Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/processing_ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ cuda = ["processing/cuda"]

[dependencies]
processing = { workspace = true }
processing_core = { workspace = true }
bevy = { workspace = true }
half = "2.7"

Expand Down
32 changes: 28 additions & 4 deletions crates/processing_ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub extern "C" fn processing_surface_create(
scale_factor: f32,
) -> u64 {
error::clear_error();
error::check(|| surface_create_windows(window_handle, width, height, scale_factor))
error::check(|| surface_create_windows(window_handle, width, height, scale_factor, false))
.map(|e| e.to_bits())
.unwrap_or(0)
}
Expand All @@ -87,7 +87,7 @@ pub extern "C" fn processing_surface_create_wayland(
) -> u64 {
error::clear_error();
error::check(|| {
surface_create_wayland(window_handle, display_handle, width, height, scale_factor)
surface_create_wayland(window_handle, display_handle, width, height, scale_factor, false)
})
.map(|e| e.to_bits())
.unwrap_or(0)
Expand All @@ -110,7 +110,7 @@ pub extern "C" fn processing_surface_create_x11(
scale_factor: f32,
) -> u64 {
error::clear_error();
error::check(|| surface_create_x11(window_handle, display_handle, width, height, scale_factor))
error::check(|| surface_create_x11(window_handle, display_handle, width, height, scale_factor, false))
.map(|e| e.to_bits())
.unwrap_or(0)
}
Expand All @@ -133,7 +133,7 @@ pub extern "C" fn processing_surface_create(
) -> u64 {
error::clear_error();
error::check(|| {
surface_create_linux(window_handle, display_handle, width, height, scale_factor)
surface_create_linux(window_handle, display_handle, width, height, scale_factor, false)
})
.map(|e| e.to_bits())
.unwrap_or(0)
Expand Down Expand Up @@ -4436,3 +4436,27 @@ fn key_code_to_u32(kc: KeyCode) -> u32 {
_ => 0,
}
}

/// Tick the Bevy app one frame.
/// Call this once per frame from your external event loop, before begin_draw.
/// Returns true if the app should continue running, false if it should exit.
///
/// This is intended for embedders that drive their own window and event loop
/// (e.g. a native C++ host) and need to advance libprocessing's internal state
/// each frame without using the built-in GLFW runner.
///
/// SAFETY:
/// - `processing_init` has been called.
/// - This is called from the same thread as `init`.
/// - This must not be called after `processing_exit`.
#[unsafe(no_mangle)]
pub extern "C" fn processing_poll_events() -> bool {
error::clear_error();
match processing_core::app_mut(|app| {
app.update();
Ok(())
}) {
Ok(_) => true,
Err(_) => false,
}
}
Loading