diff --git a/Build/Projects/MonoGame.Framework.definition b/Build/Projects/MonoGame.Framework.definition index d5defb5409a..a75ad659a02 100644 --- a/Build/Projects/MonoGame.Framework.definition +++ b/Build/Projects/MonoGame.Framework.definition @@ -343,7 +343,7 @@ Windows8,WindowsPhone81 - Angle,Linux,MacOS,Windows,WindowsGL,WindowsUniversal + Android,Angle,iOS,Linux,MacOS,Windows,WindowsGL,WindowsUniversal Android,Angle,iOS,Linux,MacOS,Ouya,WindowsGL,WindowsPhone,tvOS diff --git a/MonoGame.Framework/Graphics/GraphicsDevice.cs b/MonoGame.Framework/Graphics/GraphicsDevice.cs index bb7de0a610e..e104711805c 100644 --- a/MonoGame.Framework/Graphics/GraphicsDevice.cs +++ b/MonoGame.Framework/Graphics/GraphicsDevice.cs @@ -109,7 +109,7 @@ private bool PixelShaderDirty // Use WeakReference for the global resources list as we do not know when a resource // may be disposed and collected. We do not want to prevent a resource from being // collected by holding a strong reference to it in this list. - private readonly List _resources = new List(); + private readonly HashSet _resources = new HashSet(); // TODO Graphics Device events need implementing public event EventHandler DeviceLost; @@ -479,7 +479,7 @@ protected virtual void Dispose(bool disposing) // Dispose of all remaining graphics resources before disposing of the graphics device lock (_resourcesLock) { - foreach (var resource in _resources.ToArray()) + foreach (var resource in (new List(_resources)).ToArray()) { var target = resource.Target as IDisposable; if (target != null) @@ -570,7 +570,7 @@ internal void OnDeviceResetting() } // Remove references to resources that have been garbage collected. - _resources.RemoveAll(wr => !wr.IsAlive); + _resources.RemoveWhere(wr => !wr.IsAlive); } } diff --git a/MonoGame.Framework/Graphics/RenderTarget2D.DirectX.cs b/MonoGame.Framework/Graphics/RenderTarget2D.DirectX.cs index 7335339d8e3..6b85cc519c5 100644 --- a/MonoGame.Framework/Graphics/RenderTarget2D.DirectX.cs +++ b/MonoGame.Framework/Graphics/RenderTarget2D.DirectX.cs @@ -126,5 +126,11 @@ DepthStencilView IRenderTarget.GetDepthStencilView() GenerateIfRequired(); return _depthStencilView; } + + public void InheritDepthStencil(RenderTarget2D from) + { + if (from == null) _depthStencilView = GraphicsDevice._depthStencilView; + else _depthStencilView = from._depthStencilView; + } } } diff --git a/MonoGame.Framework/Graphics/RenderTarget2D.OpenGL.cs b/MonoGame.Framework/Graphics/RenderTarget2D.OpenGL.cs index 874c6771a8e..47f87da630f 100644 --- a/MonoGame.Framework/Graphics/RenderTarget2D.OpenGL.cs +++ b/MonoGame.Framework/Graphics/RenderTarget2D.OpenGL.cs @@ -67,5 +67,17 @@ protected override void Dispose(bool disposing) base.Dispose(disposing); } + + public void InheritDepthStencil(RenderTarget2D from) + { + if (from == null) + { + //must use other method + } else + { + ((IRenderTarget)this).GLDepthBuffer = ((IRenderTarget)from).GLDepthBuffer; + ((IRenderTarget)this).GLStencilBuffer = ((IRenderTarget)from).GLStencilBuffer; + } + } } } diff --git a/MonoGame.Framework/MacOS/MacGamePlatform.cs b/MonoGame.Framework/MacOS/MacGamePlatform.cs index 683cf7c48ff..7bc74667f8c 100644 --- a/MonoGame.Framework/MacOS/MacGamePlatform.cs +++ b/MonoGame.Framework/MacOS/MacGamePlatform.cs @@ -313,7 +313,9 @@ public override void EnterFullScreen() if (oldTitle != null) _gameWindow.Title = oldTitle; - _mainWindow.IsVisible = false; + //FIX: see https://github.com/MonoGame/MonoGame/pull/4286 + //_mainWindow.IsVisible = false; + // FIXME: EnterFullScreen gets called very early and interferes // with Synchronous mode, so disabling this for now. // Hopefully this does not cause excessive havoc. @@ -356,7 +358,9 @@ public override void ExitFullScreen() // Set the level here to normal _mainWindow.Level = NSWindowLevel.Normal; - _mainWindow.IsVisible = false; + //FIX: see https://github.com/MonoGame/MonoGame/pull/4286 + //_mainWindow.IsVisible = false; + // FIXME: EnterFullScreen gets called very early and interferes // with Synchronous mode, so disabling this for now. // Hopefully this does not cause excessive havoc. diff --git a/Tools/2MGFX/ShaderData.mojo.cs b/Tools/2MGFX/ShaderData.mojo.cs index 019e36a7c32..1e482f1ae1a 100644 --- a/Tools/2MGFX/ShaderData.mojo.cs +++ b/Tools/2MGFX/ShaderData.mojo.cs @@ -170,7 +170,7 @@ public static ShaderData CreateGLSL(byte[] byteCode, bool isVertexShader, List