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

Segue updates current activity before first draw but not first update #27

Open
TheMaverickProgrammer opened this issue Jan 12, 2025 · 0 comments

Comments

@TheMaverickProgrammer
Copy link
Owner

This problem happens when we have a screen which uses the following:

bool MyScene::IsInFocus()
{
  return getController().getCurrentActivity() == this;
}

The segue ends and gives the destination scene the current focus. But the update for this scene had run before this switch happens. Therefore, because of this gap, IsInFocus() will be true after that scene's first onDraw() but only true after that scene's second onTick().

While technically fine, this will be a major developer problem because we expect the updates to reflect the draw and programmers will need to track "next frames" to determine if IsInFocus() is useful for synchronizing the scene state and its drawables.

Additionally, this IsInFocus() is very useful. This should be an available function in Swoosh v2.

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

No branches or pull requests

1 participant