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

Remove odd engine_draw_frame call patterns. #1006

Merged
merged 2 commits into from
May 1, 2024

Conversation

DanAlbert
Copy link
Member

@DanAlbert DanAlbert commented May 1, 2024

It looks like whoever wrote this just kept adding draw calls until it worked. For some reason if I removed the call from APP_CMD_INIT_WINDOW (which really shouldn't have needed to render), or added an if (!animating) early exist to engine_draw_frame, it would prevent the app from ever rendering. I never figured out why, but in any case the most important call is the one that was missing: the one in APP_CMD_GAINED_FOCUS. That's why the rendering wouldn't start until you tapped the screen. I added that and now all the calls that appear superfluous in fact are.

Depends on #1005.

Moving this to a centrally controlled location so it's easier to migrate
to choreographer.

Also turn the stupid int into a bool.
It looks like whoever wrote this just kept adding draw calls until it
worked. For some reason if I removed the call from `APP_CMD_INIT_WINDOW`
(which really shouldn't have needed to render), or added an `if
(!animating)` early exist to engine_draw_frame, it would prevent the app
from *ever* rendering. I never figured out why, but in any case the most
important call is the one that was missing: the one in
`APP_CMD_GAINED_FOCUS`. That's why the rendering wouldn't start until
you tapped the screen. I added that and now all the calls that appear
superfluous in fact are.
@DanAlbert DanAlbert enabled auto-merge (rebase) May 1, 2024 21:55
@DanAlbert DanAlbert merged commit f541abf into android:main May 1, 2024
2 checks passed
@DanAlbert DanAlbert deleted the fix-draw-behavior branch May 1, 2024 22:31
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.

2 participants