-
Notifications
You must be signed in to change notification settings - Fork 37
MonoGameGLException when closing game through Game.Exit(). #92
Comments
Wait, Game.Exit() or Game.Dispose()? That's what I see in the trace... Either way, can you add a Console.WriteLine here for me? I'm pretty sure some GL stuff is being called after the GL context has been removed. Does this work on XNA4? Or the old WindowsGL project? |
Yep, I am receiving a WriteLine (Edit: I am also using Game.Exit() ). |
Right, will try to push the SDL2 Window/GLContext back a bit. One moment! |
End users probably didn't report a problem because they didn't notice one. The program still closes (without a dialog box) and eventually stops execution. |
Well, the current system actually works fine on the 7 or so titles I have running on it, so odds are your title's explicitly making a call that it's not happy with. Also, seems I may not be able to push it back far enough to affect anything. Just at first glance, though. |
Discovery actually, when referencing Release versions of (SDL) MonoGame.Framework.dll no exception is thrown, while debug throws. |
Hm, not sure. Not to mention, this seems to be a generic MonoGameGLException. I'm disposing the window as late as I can (the only later time I could possibly do it is on SDL2_GamePlatform.Dispose(), which isn't guaranteed to work), so I'm wondering if there's some general GL silliness that needs to be addressed. |
Actually, found a way to resolve this, nevermind~ Committing once I confirm this with all my games, may take a sec. |
Ok, so I traced it all the way through. The exception is not actually thrown on Game.Exit(), I followed it all the way out to the initial creation of the game and then .net tried to clean it up. |
As long as you explicitly call Game.Dispose() (or use |
And.... it works now, amazing 💃 , other than TextInput I'm now ready to develop with MonoGameSDL, thanks for all the help 👍 flibitijibibo! |
No problem! You've found some pretty shockingly bad flaws in MG-SDL2, glad we could help each other out. :) |
All I am doing is the usual loading of textures through ContentManager, no Texture2D.FromFile etc.
Microsoft.Xna.Framework.Graphics.MonoGameGLException was unhandled
HResult=-2146233088
Message=GL.GetError() returned InvalidOperation
Source=MonoGame.Framework
StackTrace:
at Microsoft.Xna.Framework.Graphics.GraphicsExtensions.CheckGLError() in c:\Users\Xanather\Documents\Programming\Libs\MonoGame\MonoGame.Framework\Graphics\GraphicsExtensions.cs:line 725
at Microsoft.Xna.Framework.Graphics.Texture.b__6() in c:\Users\Xanather\Documents\Programming\Libs\MonoGame\MonoGame.Framework\Graphics\Texture.cs:line 183
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.AddDisposeAction(Action disposeAction) in c:\Users\Xanather\Documents\Programming\Libs\MonoGame\MonoGame.Framework\Graphics\GraphicsDevice.cs:line 1372
at Microsoft.Xna.Framework.Graphics.Texture.Dispose(Boolean disposing) in c:\Users\Xanather\Documents\Programming\Libs\MonoGame\MonoGame.Framework\Graphics\Texture.cs:line 180
at Microsoft.Xna.Framework.Graphics.GraphicsResource.Dispose() in c:\Users\Xanather\Documents\Programming\Libs\MonoGame\MonoGame.Framework\Graphics\GraphicsResource.cs:line 125
at Microsoft.Xna.Framework.Content.ContentManager.Unload() in c:\Users\Xanather\Documents\Programming\Libs\MonoGame\MonoGame.Framework\Content\ContentManager.cs:line 645
at Microsoft.Xna.Framework.Content.ContentManager.Dispose(Boolean disposing) in c:\Users\Xanather\Documents\Programming\Libs\MonoGame\MonoGame.Framework\Content\ContentManager.cs:line 183
at Microsoft.Xna.Framework.Content.ContentManager.Dispose() in c:\Users\Xanather\Documents\Programming\Libs\MonoGame\MonoGame.Framework\Content\ContentManager.cs:line 169
at Microsoft.Xna.Framework.Game.Dispose(Boolean disposing) in c:\Users\Xanather\Documents\Programming\Libs\MonoGame\MonoGame.Framework\Game.cs:line 210
at Microsoft.Xna.Framework.Game.Dispose() in c:\Users\Xanather\Documents\Programming\Libs\MonoGame\MonoGame.Framework\Game.cs:line 190
at hidden.Program.Main() in c:\Users\Xanather\Documents\Programming\Main\hidden\hidden\Program.cs:line 24
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
The text was updated successfully, but these errors were encountered: