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

Make render loop wait for model updates #255

Closed

Conversation

armanbilge
Copy link
Collaborator

Previously, the render loop was running on every animation frame in the browser. Now, then render loop waits until there has been at least one update to the model before re-starting the render cycle.

@davesmith00000
Copy link
Member

Thanks @armanbilge, that is what we talked about.

I'm thinking about this in terms of #201 and wondering if this is the right strategy though. I'll try and mull it over on an up-coming dog walk or something. 😄

@davesmith00000
Copy link
Member

davesmith00000 commented Feb 6, 2024

@armanbilge, as it stands this PR doesn't quite work (the page never re-renders), but if you remove resetModelUpdateCount i.e. lines 41 and 90, then it appears to work perfectly.

@davesmith00000
Copy link
Member

image

Quite. 😕 emoji is my general feeling in that bit of code. Which is odd because it's barely 60 lines of not terribly complicated looking code. 😄

I'm in the middle of something at the moment, but I think when I get the chance, I'd like to see if there's some way to reformulate it that makes it easier to follow.

@davesmith00000
Copy link
Member

Closing as this issue has been resolved by another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants