Implement `background` method by tychedelia · Pull Request #1308 · processing/processing4
Allows setting the background clear color in a sketch.
Changes:
- Adds a camera when spawning a window. Note that we also add a
RenderLayerscomponent, which we'll also need to attach to any geometry spawned to render in that window. This is just hygiene for eventual multi-window apps. - Adds a simple
ColorFFI struct. We'll likely want to make this more complicated later or support all the color spaces that bevy does (even if processing doesn't). But this demonstrates how to do allocations on the Java side.
I didn't implement the PImage override here as that will require the actual renderer (i.e. not just a clear color). It's also possible the semantics here are wrong. I think processing may allow you to clear multiple times in a frame, which means drawing a fullscreen quad not setting the render pass clear. But we can follow up with that once more rendering infra is implemented.