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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.