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

Proper surface reset when resuming app on Android #39004

Merged
merged 1 commit into from
May 24, 2020

Conversation

pouleyKetchoupp
Copy link
Contributor

Just re-creating the window instead of restarting the app entirely after pausing and resuming.

Addresses remaining issue listed in #36919:
Properly handle onVkSurfaceChanged event to update the rendering system

@pouleyKetchoupp
Copy link
Contributor Author

cc @m4gr3d for review

// Update the native renderer instead of restarting the app.
// GodotLib.newcontext should not be called here once it's done.
GodotLib.newcontext(surface, false)
GodotLib.resetsurface(surface)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems the call order here is important since DisplayServerAndroid uses the size set by GodotLib.resize here to reset the window.
Would it be simpler to merge the two methods? Or to expand resetsurface to also take a width and height arguments and drop the call to resize for the VkRenderer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, no problem to merge them.

@m4gr3d m4gr3d requested a review from a team May 24, 2020 17:09
Just re-creating the window instead of restarting the app entirely.
@pouleyKetchoupp pouleyKetchoupp force-pushed the android-reset-surface branch from 2de5580 to b987677 Compare May 24, 2020 18:43
@pouleyKetchoupp
Copy link
Contributor Author

Changes from review done!

@akien-mga akien-mga merged commit 3ecdc27 into godotengine:master May 24, 2020
@akien-mga
Copy link
Member

Thanks!

@pouleyKetchoupp pouleyKetchoupp deleted the android-reset-surface branch May 24, 2020 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants