Preserve EGL context on app pause on Android #74
Merged
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.
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 itsPreserveEGLContextOnPause
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 usingGLWrapper
, 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:
Change appears to have the desired effect on both.