First off, I don’t want to sound like this is a complaint, MonoGame is absolutely fantastic. I just don’t know how to fix this.
Android builds can never resume the game gracefully. I’ve been working with XNA/MonoGame for a little while now, and I’ve always assumed I was doing something wrong, but it appears to be in the binaries. In short, both the home button and the back button can never resume the game, even though Game.Tick() is being called.
when the game is resumed, and MonoGameAndroidGameView.CreateFrameBuffer is created, as soon as GraphicsDeviceManager.ResetClientBounds is invoked, the following error appears:
I have downloaded the platformer sample to test this, and the bug is present when using the latest build (#1368) however it is not present in the NuGet binaries.
I have also tested this in the default blank game projects, and it cannot resume the simple text “hello from monogame”
I have looked into it for the last couple days, and there are a couple topics but mostly very outdated and I haven’t found a fix.
I have tried overriding the complete android lifecyle (OnPause, OnResume, OnDestroy) and haven’t found a way to bring the game back using the latest binaries.
Has anyone found a way to do this? All I want is for the player to be able to hit the home button and be able to come back to the game again.
Yea, it’s as simple as installing the latest Visual Studio build, and creating a new project from one of the templates. The game runs fine, until the home button is pressed and then the game is opened again from recents. It appears that it doesn’t draw anything from spritebatch (although spritebatch.clear still shows the default cornflowerblue).
Although before the nexus would quietly throw the GL_INVALID_OPERATION, and now it actually halts and throws the error:
Microsoft.Xna.Framework.Graphics.MonoGameGLException: GL.GetError() returned InvalidOperation
Also, just to reiterate, using the version present in the nuget packages fixes this issue. I just tested it on the github project I created (sanity check) and indeed, everything works when I use the older nuget build.
Hello. I just started trying monogame out and without further checking what error gets raised it sounds just like what I am experiencing too.
Is this officially a bug now or not? @MrEmo did you happen to find an answer or a workaround somewhere else?
Edit: Uhm… excuse me for reviving this thread. On mobile it showed October 14th and seemed more recent but after my reply it says ‘5 years later’ … Sorry about that!