Skip to content
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

What if Context objects became the interface between the engine and rendering? #39

Open
jonathanhogg opened this issue Feb 6, 2024 · 1 comment
Labels
💡 idea A hair-brained concept 🧱 model Anything to do with the underlying graph/value model 🎨 render Anything to do with rendering (windows, physics, etc.)

Comments

@jonathanhogg
Copy link
Owner

Following on from an idea in #38 of putting references into Context so that @context_funcs can access them, what if the Context was also passed into renderers instead of the current mish-mash of engine, node, references and global names?

Other than possibly just being neater, another key advantage of doing this would be allowing renderers to update the warnings and errors sets. At the moment, there's no good way for renderers to log problems that wouldn't spam the console on each frame, so they tend to just eat errors and forget about them.

@jonathanhogg
Copy link
Owner Author

Ways that engine is currently used by renderers:

  • physics uses .target_fps and .state
  • controller.driver uses .state and .counter, plus calls .has_next_page(), .next_page(), .has_previous_page() and .previous_page()
  • controller.push2 uses .counter
  • window uses .state and calls .next_page() and .previous_page()

Engine's .state is in the Context already and .target_fps is in the names dictionary. Adding the counter into the context sounds reasonable. The page stuff probably needs abstracting into a better concept of actions (or events?) that would make it easier for controllers to trigger things.

There is probably also an argument for having BeatCounter become part of flitter.model.

@jonathanhogg jonathanhogg added 🚀 enhancement New feature or request 🎨 render Anything to do with rendering (windows, physics, etc.) 🧱 model Anything to do with the underlying graph/value model 💡 idea A hair-brained concept and removed 🚀 enhancement New feature or request labels Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 idea A hair-brained concept 🧱 model Anything to do with the underlying graph/value model 🎨 render Anything to do with rendering (windows, physics, etc.)
Projects
None yet
Development

No branches or pull requests

1 participant