Getting OpenGL exception when including current development branch source on Mac

I am trying to add the MonoGame source to my project. The project runs fine when using the stable MonoGame 3.5.1 binaries, but fails with an OpenGL exception when changing to source. I am using XS 5.10.3 on an El Capitan Macbook Pro. It is 6 years old, so only supports OpenGL 3.3. I tried going to the v3.5.1 branch and get the same error.

Steps I took to use source:

  1. From my project, remove the References to MonoGame.Framework, NVorbis, and OpenTK.
  2. Add existing project for MonoGame.Framework/MonoGame.Framework.MacOS.csproj.
  3. Add a reference to my project under projects MonoGame.Framework.MacOS.
  4. Clean All, Build All, Run debug.

Console output:

Loaded assembly: /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/bin/Debug/TestMonoMac.app/Contents/MonoBundle/TestMonoMac.exe
Loaded assembly: /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/bin/Debug/TestMonoMac.app/Contents/MonoBundle/MonoGame.Framework.dll
Loaded assembly: /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/bin/Debug/TestMonoMac.app/Contents/MonoBundle/Xamarin.Mac.dll [External]
Loaded assembly: /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/bin/Debug/TestMonoMac.app/Contents/MonoBundle/System.dll [External]
Loaded assembly: /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/bin/Debug/TestMonoMac.app/Contents/MonoBundle/System.Net.Http.dll [External]
Loaded assembly: /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/bin/Debug/TestMonoMac.app/Contents/MonoBundle/Mono.Security.dll [External]
Loaded assembly: /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/bin/Debug/TestMonoMac.app/Contents/MonoBundle/System.Configuration.dll [External]
Loaded assembly: /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/bin/Debug/TestMonoMac.app/Contents/MonoBundle/System.Xml.dll [External]
Loaded assembly: /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/bin/Debug/TestMonoMac.app/Contents/MonoBundle/System.Security.dll [External]
Loaded assembly: /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/bin/Debug/TestMonoMac.app/Contents/MonoBundle/OpenTK.dll [External]
Loaded assembly: /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/bin/Debug/TestMonoMac.app/Contents/MonoBundle/System.Drawing.dll [External]
Loaded assembly: /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/bin/Debug/TestMonoMac.app/Contents/MonoBundle/System.Runtime.Serialization.dll [External]
Loaded assembly: /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/bin/Debug/TestMonoMac.app/Contents/MonoBundle/System.ServiceModel.Internals.dll [External]
Loaded assembly: /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/bin/Debug/TestMonoMac.app/Contents/MonoBundle/System.Core.dll [External]
Loaded assembly: /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/bin/Debug/TestMonoMac.app/Contents/MonoBundle/Mono.Posix.dll [External]
GraphicsAdapter.DefaultAdapter.SupportedDisplayModes={{Width:1920 Height:1200 Format:Color}}
2016-07-15 11:15:09.900 TestMonoMac[51509:18389633] 
Unhandled Exception:
Microsoft.Xna.Framework.Graphics.MonoGameGLException: GL.GetError() returned InvalidFramebufferOperationExt
  at Microsoft.Xna.Framework.Graphics.GraphicsExtensions.CheckGLError () [0x00024] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Graphics/GraphicsExtensions.cs:905 
  at Microsoft.Xna.Framework.Graphics.GraphicsDevice.PlatformClear (ClearOptions options, Vector4 color, Single depth, Int32 stencil) [0x0010a] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.OpenGL.cs:350 
  at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Clear (Color color) [0x00020] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs:429 
  at Microsoft.Xna.Framework.Graphics.GraphicsDevice.ApplyRenderTargets (Microsoft.Xna.Framework.Graphics.RenderTargetBinding[] renderTargets) [0x000c1] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs:777 
  at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Initialize () [0x000ca] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs:289 
  at Microsoft.Xna.Framework.Graphics.GraphicsDevice..ctor (Microsoft.Xna.Framework.Graphics.GraphicsAdapter adapter, GraphicsProfile graphicsProfile, Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters) [0x0013c] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs:211 
  at Microsoft.Xna.Framework.GraphicsDeviceManager.Initialize () [0x00089] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/GraphicsDeviceManager.Legacy.cs:393 
  at Microsoft.Xna.Framework.GraphicsDeviceManager.CreateDevice () [0x00002] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/GraphicsDeviceManager.Legacy.cs:84 
  at Microsoft.Xna.Framework.GamePlatform.BeforeInitialize () [0x0003a] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/GamePlatform.cs:144 
  at Microsoft.Xna.Framework.Game.DoInitialize () [0x0000d] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Game.cs:678 
  at Microsoft.Xna.Framework.Game.Run (GameRunBehavior runBehavior) [0x0003b] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Game.cs:384 
  at Microsoft.Xna.Framework.Game.Run () [0x0000d] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Game.cs:370 
  at TestMonoMac.Program.Main (System.String[] args) [0x0000e] in /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/Main.cs:24 
[ERROR] FATAL UNHANDLED EXCEPTION: Microsoft.Xna.Framework.Graphics.MonoGameGLException: GL.GetError() returned InvalidFramebufferOperationExt
  at Microsoft.Xna.Framework.Graphics.GraphicsExtensions.CheckGLError () [0x00024] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Graphics/GraphicsExtensions.cs:905 
  at Microsoft.Xna.Framework.Graphics.GraphicsDevice.PlatformClear (ClearOptions options, Vector4 color, Single depth, Int32 stencil) [0x0010a] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.OpenGL.cs:350 
  at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Clear (Color color) [0x00020] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs:429 
  at Microsoft.Xna.Framework.Graphics.GraphicsDevice.ApplyRenderTargets (Microsoft.Xna.Framework.Graphics.RenderTargetBinding[] renderTargets) [0x000c1] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs:777 
  at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Initialize () [0x000ca] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs:289 
  at Microsoft.Xna.Framework.Graphics.GraphicsDevice..ctor (Microsoft.Xna.Framework.Graphics.GraphicsAdapter adapter, GraphicsProfile graphicsProfile, Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters) [0x0013c] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs:211 
  at Microsoft.Xna.Framework.GraphicsDeviceManager.Initialize () [0x00089] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/GraphicsDeviceManager.Legacy.cs:393 
  at Microsoft.Xna.Framework.GraphicsDeviceManager.CreateDevice () [0x00002] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/GraphicsDeviceManager.Legacy.cs:84 
  at Microsoft.Xna.Framework.GamePlatform.BeforeInitialize () [0x0003a] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/GamePlatform.cs:144 
  at Microsoft.Xna.Framework.Game.DoInitialize () [0x0000d] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Game.cs:678 
  at Microsoft.Xna.Framework.Game.Run (GameRunBehavior runBehavior) [0x0003b] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Game.cs:384 
  at Microsoft.Xna.Framework.Game.Run () [0x0000d] in /Users/ksuda/Documents/My Xarmarin Projects/MonoGameSource/MonoGame/MonoGame.Framework/Game.cs:370 
  at TestMonoMac.Program.Main (System.String[] args) [0x0000e] in /Users/ksuda/Documents/My Xarmarin Projects/TestMono/TestMonoMac/Main.cs:24 

I also tried adding references to my project for OpenTK and Tao.Sdl, but that didn’t change the error. Is there something else I should be adding or changing to use MonoGame from source?

In continuing to dig with lack of response, I have determined what what I have working as MonoGame 3.5.1 on my mac does not seem to correspond to anything in GitHub. The project that works without source uses NVorbis.dll, and the ones from Master, Develop, or tags/v3.5.1 don’t. I did see issue #3581 ( https://github.com/mono/MonoGame/issues/3581 ), but the fix mentioned in that issue does not work for me, as it just fails at the next error check. Comment out enough error checks and the process silently exits.

Is it possible that what is labeled in the downloads as Stable 3.5.1 for Mac XS, is actually not 3.5.1? In testing an MFi game controller on my mac, the dpad button IsPressed does not work and the left thumbstick up and down is reversed. At least the dpad one was supposed to be fixed by the merged change in https://github.com/mono/MonoGame/pull/4385 as a part of 3.5. Is there any way to look at the actual files for MonoGame and determine what version they are without relying on the directory path? The files do have a March 30 date on them in /Library/Frameworks/MonoGame.framework/v3.5.1.1679/Assemblies/MacOSX.

And the saga continues. Just in case someone ends up here, where I have gone next is to download the develop branch pack for the mac and install that. After creating a new MonoGame Xamarin.mac template package, I am getting the same error that is in Issue#5044, System.DllNotFoundException: libSDL2.dylib. Except this libSDL2-2.0.0.dylib is not included as a part of the project. Adding the file is easy enough, but I don’t see where to add the ddlmap entry to pickup that the refrerence to libSDL2.dylib should be mapped to libSDL2-2.0.0.dylib. Forward progress is forward progress. Perhaps the MonoGame Xamarin.mac template is obsolete and there should be a new one that is a stripped down version of the Cross-platform one? I don’t really want a single app that runs on three platforms. I would rather have separate apps, one for each platform. But I’m just a purist that way.