-
Notifications
You must be signed in to change notification settings - Fork 2
background_image example in python #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
crates/processing_ffi/src/lib.rs
Outdated
| pub extern "C" fn processing_init() { | ||
| error::clear_error(); | ||
| error::check(init); | ||
| error::check(|| init(None)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll eventually need to accept configuration over FFI
tychedelia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few comments, yay!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep this just in the root assets folder and figure out how to point the python examples there? That way we can share test assets between rust and python.
| 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}")))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
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: