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

Call Android native renderer while opengl context is still valid #1504

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

rh101
Copy link
Contributor

@rh101 rh101 commented Dec 11, 2023

Which branch your pull-request should merge into?

  • dev: Current 2.x BugFixs or Features

Describe your changes

This change is part of a combination of changes that are required to ensure that the Android application does not crash due to an invalid OpenGL context.

The specific issue this PR addresses is that the Android native render was being called after a Thread.sleep, at which point the OpenGL context may not be valid. This may be because of the app going to the background (for example, during a phone call etc.) during the onDrawFrame call, just prior to it exiting the Thread.sleep, and if for any reason Android invalidates the OpenGL context, this would cause a crash.

Issue ticket number and link

#1211

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • I have checked readme and add important infos to this PR (if it needed).
  • I have added/adapted some tests too.

@halx99 halx99 linked an issue Dec 12, 2023 that may be closed by this pull request
@halx99 halx99 added the enhancement New feature or request label Dec 12, 2023
@halx99 halx99 added this to the 2.1.0-LTS milestone Dec 12, 2023
@halx99 halx99 merged commit baa9de1 into axmolengine:dev Dec 12, 2023
8 checks passed
@rh101 rh101 deleted the android-render-fix branch December 12, 2023 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CommandBufferGL::drawElements Crash
2 participants