-
Notifications
You must be signed in to change notification settings - Fork 988
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
Disable Tone.Draw() programmatically or automatically #194
Comments
Makes sense. I think the best fix would be if the draw loop only ran when something is pushed onto the events queue, and that it stops updating when the queue is empty. While i was thinking through how to do it, i went ahead an implemented it. (I'll commit it in a moment). but thanks for the offer! Do you think it'd be useful to be able to manually control the updating? for example, setting |
@tambien thanks for looking at this. I agree that the automatic scheduling works well (especially in my situation as I'm not currently using the Draw functionality). As to manually being able to update, yes I think that could be useful for power users who are using Draw but want to manage when it is invoked manually in their own loop. 🎶 |
@tambien now that I'm looking at this a little closer, the |
The new
Draw
functionality is really cool and it's great to see it in the newest release.However, there doesn't seem to be a way to disable it for scenarios where there is already an existing usage of
requestAnimationFrame
running alongside it.Using a single requestAnimationFrame can have a positive performance impact because the
self
of running the function itself can be impactful. Looks like there is other minor overhead from the_drawLoop
function as well.Here is a screenshot of the profile I ran to discover this:
Would it be possible to either provide a mechanism to programmatically disable it or to not have it running the callback until there is a scheduled event?
I can help with implementation with a bit of guidance.
The text was updated successfully, but these errors were encountered: