I can’t seem to track this one down. This can be reproduced by doing the following on Mac:
- pull MonoGame source from GitHub
- run mono Protobuild.exe to generate project files
- build the solution
- create a fresh MonoGame project
- replace all NuGet references with a reference to the MonoGame.Framework.MacOS project
Run that and it results in an InvalidFramebufferOperationExt the first time GL.Clear is called. Running in release mode works fine since CheckGLError is a noop for non-DEBUG builds. Any ideas what’s going on here?
Unhandled Exception:
Microsoft.Xna.Framework.Graphics.MonoGameGLException: GL.GetError() returned InvalidFramebufferOperationExt
at Microsoft.Xna.Framework.Graphics.GraphicsExtensions.CheckGLError () [0x00024] in /Users/desaro/Desktop/MG/MonoGame.Framework/Graphics/GraphicsExtensions.cs:883
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.PlatformClear (ClearOptions options, Vector4 color, Single depth, Int32 stencil) [0x0010a] in /Users/desaro/Desktop/MG/MonoGame.Framework/Graphics/GraphicsDevice.OpenGL.cs:314
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Clear (Color color) [0x00020] in /Users/desaro/Desktop/MG/MonoGame.Framework/Graphics/GraphicsDevice.cs:417
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.ApplyRenderTargets (Microsoft.Xna.Framework.Graphics.RenderTargetBinding[] renderTargets) [0x000c1] in /Users/desaro/Desktop/MG/MonoGame.Framework/Graphics/GraphicsDevice.cs:722
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Initialize () [0x000b9] in /Users/desaro/Desktop/MG/MonoGame.Framework/Graphics/GraphicsDevice.cs:277
at Microsoft.Xna.Framework.Graphics.GraphicsDevice..ctor (Microsoft.Xna.Framework.Graphics.GraphicsAdapter adapter, GraphicsProfile graphicsProfile, Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters) [0x00122] in /Users/desaro/Desktop/MG/MonoGame.Framework/Graphics/GraphicsDevice.cs:200
at Microsoft.Xna.Framework.GraphicsDeviceManager.Initialize () [0x00089] in /Users/desaro/Desktop/MG/MonoGame.Framework/GraphicsDeviceManager.cs:385
at Microsoft.Xna.Framework.GraphicsDeviceManager.CreateDevice () [0x00002] in /Users/desaro/Desktop/MG/MonoGame.Framework/GraphicsDeviceManager.cs:90
at Microsoft.Xna.Framework.GamePlatform.BeforeInitialize () [0x0003a] in /Users/desaro/Desktop/MG/MonoGame.Framework/GamePlatform.cs:207
at Microsoft.Xna.Framework.Game.DoInitialize () [0x0000d] in /Users/desaro/Desktop/MG/MonoGame.Framework/Game.cs:678
at Microsoft.Xna.Framework.Game.Run (GameRunBehavior runBehavior) [0x0003b] in /Users/desaro/Desktop/MG/MonoGame.Framework/Game.cs:384
at Microsoft.Xna.Framework.Game.Run () [0x0000d] in /Users/desaro/Desktop/MG/MonoGame.Framework/Game.cs:370
at TesterProject.AppDelegate.FinishedLaunching (MonoMac.Foundation.NSObject notification) [0x00037] in /Users/desaro/Desktop/MG/TesterProject/Main.cs:49
at (wrapper dynamic-method) System.Object:[TesterProject.AppDelegate:Void FinishedLaunching(MonoMac.Foundation.NSObject)] (MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector,MonoMac.Foundation.NSObject)
at (wrapper native-to-managed) System.Object:[TesterProject.AppDelegate:Void FinishedLaunching(MonoMac.Foundation.NSObject)] (MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector,MonoMac.Foundation.NSObject)
at (wrapper managed-to-native) MonoMac.AppKit.NSApplication:NSApplicationMain (int,string[])
at MonoMac.AppKit.NSApplication.Main (System.String[] args) [0x0003d] in <filename unknown>:0
at TesterProject.Program.Main (System.String[] args) [0x0001d] in /Users/desaro/Desktop/MG/TesterProject/Main.cs:26
[ERROR] FATAL UNHANDLED EXCEPTION: Microsoft.Xna.Framework.Graphics.MonoGameGLException: GL.GetError() returned InvalidFramebufferOperationExt
at Microsoft.Xna.Framework.Graphics.GraphicsExtensions.CheckGLError () [0x00024] in /Users/desaro/Desktop/MG/MonoGame.Framework/Graphics/GraphicsExtensions.cs:883
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.PlatformClear (ClearOptions options, Vector4 color, Single depth, Int32 stencil) [0x0010a] in /Users/desaro/Desktop/MG/MonoGame.Framework/Graphics/GraphicsDevice.OpenGL.cs:314
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Clear (Color color) [0x00020] in /Users/desaro/Desktop/MG/MonoGame.Framework/Graphics/GraphicsDevice.cs:417
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.ApplyRenderTargets (Microsoft.Xna.Framework.Graphics.RenderTargetBinding[] renderTargets) [0x000c1] in /Users/desaro/Desktop/MG/MonoGame.Framework/Graphics/GraphicsDevice.cs:722
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Initialize () [0x000b9] in /Users/desaro/Desktop/MG/MonoGame.Framework/Graphics/GraphicsDevice.cs:277
at Microsoft.Xna.Framework.Graphics.GraphicsDevice..ctor (Microsoft.Xna.Framework.Graphics.GraphicsAdapter adapter, GraphicsProfile graphicsProfile, Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters) [0x00122] in /Users/desaro/Desktop/MG/MonoGame.Framework/Graphics/GraphicsDevice.cs:200
at Microsoft.Xna.Framework.GraphicsDeviceManager.Initialize () [0x00089] in /Users/desaro/Desktop/MG/MonoGame.Framework/GraphicsDeviceManager.cs:385
at Microsoft.Xna.Framework.GraphicsDeviceManager.CreateDevice () [0x00002] in /Users/desaro/Desktop/MG/MonoGame.Framework/GraphicsDeviceManager.cs:90
at Microsoft.Xna.Framework.GamePlatform.BeforeInitialize () [0x0003a] in /Users/desaro/Desktop/MG/MonoGame.Framework/GamePlatform.cs:207
at Microsoft.Xna.Framework.Game.DoInitialize () [0x0000d] in /Users/desaro/Desktop/MG/MonoGame.Framework/Game.cs:678
at Microsoft.Xna.Framework.Game.Run (GameRunBehavior runBehavior) [0x0003b] in /Users/desaro/Desktop/MG/MonoGame.Framework/Game.cs:384
at Microsoft.Xna.Framework.Game.Run () [0x0000d] in /Users/desaro/Desktop/MG/MonoGame.Framework/Game.cs:370
at TesterProject.AppDelegate.FinishedLaunching (MonoMac.Foundation.NSObject notification) [0x00037] in /Users/desaro/Desktop/MG/TesterProject/Main.cs:49
at (wrapper dynamic-method) System.Object:[TesterProject.AppDelegate:Void FinishedLaunching(MonoMac.Foundation.NSObject)] (MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector,MonoMac.Foundation.NSObject)
at (wrapper native-to-managed) System.Object:[TesterProject.AppDelegate:Void FinishedLaunching(MonoMac.Foundation.NSObject)] (MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector,MonoMac.Foundation.NSObject)
at (wrapper managed-to-native) MonoMac.AppKit.NSApplication:NSApplicationMain (int,string[])
at MonoMac.AppKit.NSApplication.Main (System.String[] args) [0x0003d] in <filename unknown>:0
at TesterProject.Program.Main (System.String[] args) [0x0001d] in /Users/desaro/Desktop/MG/TesterProject/Main.cs:26