Fix run loop; correctly integrate changes. #36
Merged
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.
Two small changes:
runmethod to avoid re-entrancy. This is how I originally had it but wanted to hide it behind a method onGraphics. The problem is that running the user's sketch (i.e.draw.call0) will call back intographics_mutfor any operations, so if we are already holding a mutable borrow inside the run loop, we will blow up when we try to do anything.There's a number of more appropriate fixes. Namely, only
GlfwContextactually need to be mutably accessed through Rust. Everything else could in theory just be&self. This is a broader thing we'll want to consider. I think just switching towinitis probably the right call.Graphicsre: Refactor rendering crate to clarify primary Processing API #34. I just fixed the compile errors but didn't correctly pull out surface into its own object.