Conversation
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.
…tion
Exposes a C FFI function that ticks Bevy's app one frame, allowing
embedders that manage their own window and event loop (e.g. a native
C++ host using GLFW) to advance libprocessing's internal state each
frame without using the built-in GLFW runner.
The pattern is:
processing_init();
processing_surface_create(...);
processing_graphics_create(...);
while (running) {
running = processing_poll_events();
processing_begin_draw(gfx);
// draw calls
processing_end_draw(gfx);
}
Adds processing_core as a direct dependency of processing_ffi since
app_mut is not re-exported through processing::prelude.
|
Thanks for this! I don't think we need it for the loop in the description: processing_end_draw already runs |
|
I think it's better to open up an issue before making changes to the core functionality. It needs to be discussed, especially by people who are newer to the project |
Summary
Adds
processing_poll_events()to the C FFI, which ticks Bevy's app one frame. This lets embedders that manage their own window and event loop advance libprocessing's internal state each frame without using the built-in runner.Motivation
When embedding libprocessing into a native host that drives its own event loop, there is no way to tick the Bevy app from outside. The Python bindings have
poll_events()on theSurfacestruct but this is not exposed over C.The window system the host uses does not matter. The host creates a WebGPU surface via
processing_surface_create, passes native window and display handles, and drives the frame loop itself.processing_poll_eventsis what advances Bevy's ECS and render world each frame in that model.Usage
Changes
processing_poll_events() -> booltoprocessing_ffi/src/lib.rsprocessing_coreas a direct dependency ofprocessing_ffisinceapp_mutis not re-exported throughprocessing::preludeNotes
This builds on top of #236 since that fix is required for the crate to compile on Linux.