Initial image implementation#5
Merged
tychedelia merged 11 commits intoprocessing:mainfrom Dec 3, 2025
Merged
Conversation
Contributor
|
Some of the imports have changed, and I think the linux code paths need to namespace I'm happy to help with this in a separate PR, but still need to dig into which change affects wayland |
catilac
requested changes
Nov 26, 2025
Contributor
catilac
left a comment
There was a problem hiding this comment.
Yay, okay this works! The build is broken due to the c_void namespacing issue I mentioned. Once build passes this is good to go
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.
Adds initial support for
PImagebacked by abevy::image::Image. This doesn't include everything we'll need, just enough to render a background image to demonstrate the basic flow works.Some important implementation notes:
Entityrather than exposeHandle<Image>to users. This allows us to have a consistent return type across FFI for anything stored in the ECS.PImagestores a variety of things useful for interacting with an image, most notable including a readback staging buffer for us to copy it into. This is expensive (basically doubles the cost of every texture in vram) but avoids having to allocate on demand when the user callsloadPixels. We can add more intelligent deferral/caching later.image.rs. In short, to avoid annoying borrowing errors when interacting with&mut World, we create a one-off system that we call instead, which allows Bevy to do the validation at runtime that our borrows are okay. A basic sketch of how this works:You may not have seen systems with
Inparameters and return arguments, but systems can accept context this way when called directly! Note that thecachedon theworld.run_system_cached_withmeans that the system is registered behind the scenes so its query will be cached.Minor notes:
create_surfacetosurface_createto properly namespace things in our FFI layer. We'll probably want to go even further here just for good measure (i.e.processing_graphics_begin_draw) but that's for another PR.