Remove MainLoop.method. NFC#26254
Merged
sbc100 merged 1 commit intoemscripten-core:mainfrom Feb 13, 2026
Merged
Conversation
The `MainLoop.method` property seems to be a string version of `MainLoop.timingMode`. It had exactly one user which was to generate a warning. The warning was firing in the case when the method was `timeout` (which is the same as `timingMode` == `EM_TIMING_SETTIMEOUT`). The warning code would then reset `MainLoop.method` so that it would only fire "once per set main loop". However, since this was changed to `warnOnce` in emscripten-core#10090, the warning actually only fires once per program run.
kripken
reviewed
Feb 12, 2026
| warnOnce('Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!'); | ||
| } | ||
| #endif | ||
| } |
Member
There was a problem hiding this comment.
this looks wrong - now the warning only happens for timingMode = SETTIMEOUT?
Collaborator
Author
There was a problem hiding this comment.
Yes, but that was true before this change too.
Before: check MainLoop.method === 'timeout'
After: check MainLoop.timingMode == EM_TIMING_SETTIMEOUT
But these checks are the same thing since method is only set to timeout then timeingMode is EM_TIMING_SETTIMEOUT
kripken
approved these changes
Feb 12, 2026
| warnOnce('Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!'); | ||
| } | ||
| #endif | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
MainLoop.methodproperty seems to be a string version ofMainLoop.timingMode.It had exactly one user which was to generate a warning. The warning was firing in the case when the method was
timeout(which is the same astimingMode==EM_TIMING_SETTIMEOUT). The warning code would then resetMainLoop.methodso that it would only fire "once per set main loop". However, since this was changed towarnOncein #10090, the warning actually only fires once per program run.