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

Preserve EGL context on app pause on Android #74

Merged
merged 1 commit into from
Dec 22, 2021

Conversation

bdach
Copy link

@bdach bdach commented Dec 21, 2021

This is the minimum viable change that makes it so that osu!framework apps can run on Android without losing the GL context immediately upon pause. This is achieved using GLSurfaceView and its PreserveEGLContextOnPause property (added in API level 11, so below the minimum version of 21 declared by framework projects and game).

Unfortunately I've had to also add and set a fake IRenderer instance, because without it the game would not render on one of my test devices. The renderer could be used in the future by framework to issue GL calls rather than fire them internally using GLWrapper, but I'm not going to be making that change now as that's a huge undertaking.

Tested on two Android devices that I own:

  • Samsung Galaxy J7 2016 / SM-J710F (Android 7),
  • OnePlus 8T / KB2003 (Android 11)

Change appears to have the desired effect on both.

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.

3 participants