Bug 9494 - AndroidGameView cannot pause without losing gl context
Summary: AndroidGameView cannot pause without losing gl context
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.4.x
Hardware: PC Windows
: Low normal
Target Milestone: ---
Assignee: Radek Doulik
URL: http://forums.xamarin.com/discussion/...
Depends on:
Blocks:
 
Reported: 2013-01-11 11:02 UTC by dean.ellis
Modified: 2014-01-14 16:21 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description dean.ellis 2013-01-11 11:02:55 UTC
This is an issue when the OpenGL context is destroyed when the application is Paused. On older devices this was valid, however newer devices (post Android 3.0 I think) have the ability to keep hold of the GL Context during the Pause state and reuse it when the application is Resumed. 

Currently the Context and the Surface are tightly coupled, which means when the SurfaceDestroyed event is fired from the ISurfaceHolderCallback the context is removed as well as the Surface. To fix the issue the Context and Surface need to be de-coupled so that a Context can be kept even if the Surface is destroyed and then re-attached ones the SurfaceCreated is called.
Comment 1 Aranda 2013-07-31 13:28:48 UTC
Further discussion about the issue here:
http://forums.xamarin.com/discussion/621/androidgameview-pause-without-losing-gl-context

I feel that the priority on this should be greater than "low normal". Games often have a lot of textures loaded and when the GL context is destroyed, all these textures have to be reloaded which can cause a significant wait for the user. Other frameworks do not suffer this issue, which makes Xamarin/MonoGame a less desirable option for game developers.
Comment 2 support 2013-12-07 06:35:29 UTC
Hello

almost one year since the bug notification. Is it possible to speed up the fix a little bit? Most MonoGame ports to Android suffer from this problem, making the resume time really long or impossible to port.
Comment 4 Radek Doulik 2014-01-14 16:21:45 UTC
The fix landed in master branch. Hopefully it will make it to the next alpha release.