background_image example in python#46
Merged
catilac merged 15 commits intoprocessing:mainfrom Dec 27, 2025
Merged
Conversation
catilac
commented
Dec 22, 2025
catilac
commented
Dec 22, 2025
catilac
commented
Dec 24, 2025
crates/processing_ffi/src/lib.rs
Outdated
| pub extern "C" fn processing_init() { | ||
| error::clear_error(); | ||
| error::check(init); | ||
| error::check(|| init(None)); |
Contributor
Author
There was a problem hiding this comment.
We'll eventually need to accept configuration over FFI
tychedelia
requested changes
Dec 25, 2025
| init().map_err(|e| PyRuntimeError::new_err(format!("{e}")))?; | ||
| let mut config = Config::new(); | ||
| config.set(ConfigKey::AssetRootPath, asset_path.to_string()); | ||
| init(Some(config)).map_err(|e| PyRuntimeError::new_err(format!("{e}")))?; |
Member
There was a problem hiding this comment.
Not for this PR but I think we'll want to figure out how to move init to module load or some other global context to support multiple graphics at the same time. Although I think it's also idempotent, so maybe this is actually fine?
tychedelia
approved these changes
Dec 27, 2025
| let config = world.resource_mut::<Config>(); | ||
| let path: AssetPath = match config.get(ConfigKey::AssetRootPath) { | ||
| Some(_) => { | ||
| AssetPath::from_path_buf(path).with_source(AssetSourceId::from("assets_directory")) |
Member
There was a problem hiding this comment.
This name ("assets_directory") might be confusing for contributors coming from bevy (as that's canonically assets/) but I can't think of a better name off the top of my head.
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.
The background_image stuff works. And we are able to set a more appropriate asset path than the location of
pythonCreated a new
Configtype based on aHashMap. It should do for now, but maybe there is a better solution.TODO: