diff --git a/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj b/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj index d442dd82659..124189b2f9e 100644 --- a/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj +++ b/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj @@ -174,5 +174,6 @@ + diff --git a/MonoGame.Framework.Content.Pipeline/Processors/EffectProcessor.cs b/MonoGame.Framework.Content.Pipeline/Processors/EffectProcessor.cs index 194b0f58674..1e2b0e80bb3 100644 --- a/MonoGame.Framework.Content.Pipeline/Processors/EffectProcessor.cs +++ b/MonoGame.Framework.Content.Pipeline/Processors/EffectProcessor.cs @@ -97,6 +97,10 @@ private string GetProfileForPlatform(TargetPlatform platform) return "OpenGL"; case TargetPlatform.DesktopVK: return "Vulkan"; + case TargetPlatform.WindowsGDK: + case TargetPlatform.XboxOne: + case TargetPlatform.XboxSeries: + return "GDK"; } return platform.ToString(); diff --git a/MonoGame.Framework.Content.Pipeline/Serialization/Compiler/ContentWriter.cs b/MonoGame.Framework.Content.Pipeline/Serialization/Compiler/ContentWriter.cs index d433a191f58..e9e7785dc7c 100644 --- a/MonoGame.Framework.Content.Pipeline/Serialization/Compiler/ContentWriter.cs +++ b/MonoGame.Framework.Content.Pipeline/Serialization/Compiler/ContentWriter.cs @@ -55,6 +55,8 @@ public sealed class ContentWriter : BinaryWriter 'S', // Nintendo Switch 'b', // WebAssembly and Bridge.NET 'V', // DesktopVK (Vulkan) + 'G', // Windows GDK + 's', // Xbox Series }; /// diff --git a/MonoGame.Framework.Content.Pipeline/TargetPlatform.cs b/MonoGame.Framework.Content.Pipeline/TargetPlatform.cs index 503dcf28144..0f23414aa94 100644 --- a/MonoGame.Framework.Content.Pipeline/TargetPlatform.cs +++ b/MonoGame.Framework.Content.Pipeline/TargetPlatform.cs @@ -91,6 +91,15 @@ public enum TargetPlatform /// All desktop versions using Vulkan. /// DesktopVK, + + /// Windows GDK + /// + WindowsGDK, + + /// + /// Xbox Series + /// + XboxSeries } diff --git a/MonoGame.Framework/Content/ContentManager.cs b/MonoGame.Framework/Content/ContentManager.cs index 41f5aaec1f9..c2ac1e3e2f6 100644 --- a/MonoGame.Framework/Content/ContentManager.cs +++ b/MonoGame.Framework/Content/ContentManager.cs @@ -50,6 +50,8 @@ public partial class ContentManager : IDisposable 'S', // Nintendo Switch 'b', // WebAssembly and Bridge.NET 'V', // DesktopVK + 'G', // Windows GDK + 's', // Xbox Series // NOTE: There are additional identifiers for consoles that // are not defined in this repository. Be sure to ask the diff --git a/MonoGame.Framework/Platform/Windows/WinFormsGamePlatform.cs b/MonoGame.Framework/Platform/Windows/WinFormsGamePlatform.cs index 885ad72fee0..5037d0a21da 100644 --- a/MonoGame.Framework/Platform/Windows/WinFormsGamePlatform.cs +++ b/MonoGame.Framework/Platform/Windows/WinFormsGamePlatform.cs @@ -80,6 +80,11 @@ public override bool BeforeUpdate(GameTime gameTime) public override bool BeforeDraw(GameTime gameTime) { +#if GDKX + var device = Game.GraphicsDevice; + if (device != null) + device.PlatformPrepare(); // maybe add a Prepare() to GraphicsDevice, could be useful for other backend? +#endif return true; } @@ -126,7 +131,9 @@ protected override void Dispose(bool disposing) _window = null; Window = null; } +#if !GDKX Microsoft.Xna.Framework.Media.MediaManagerState.CheckShutdown(); +#endif } base.Dispose(disposing); diff --git a/MonoGame.Framework/Utilities/GraphicsBackend.cs b/MonoGame.Framework/Utilities/GraphicsBackend.cs index d93dff82edb..06edd6d435d 100644 --- a/MonoGame.Framework/Utilities/GraphicsBackend.cs +++ b/MonoGame.Framework/Utilities/GraphicsBackend.cs @@ -10,7 +10,7 @@ namespace MonoGame.Framework.Utilities public enum GraphicsBackend { /// - /// Represents the Microsoft DirectX graphics backend. + /// Represents the Microsoft DirectX 11 graphics backend. /// DirectX, @@ -27,6 +27,11 @@ public enum GraphicsBackend /// /// Represents the Apple Metal graphics backend. /// - Metal + Metal, + + /// + /// Represents the Microsoft DirectX 12 graphics backend. (GDKX only for now) + /// + DirectX12 } } \ No newline at end of file diff --git a/MonoGame.Framework/Utilities/MonoGamePlatform.cs b/MonoGame.Framework/Utilities/MonoGamePlatform.cs index 1d5dc8d746f..05f6b6b73b5 100644 --- a/MonoGame.Framework/Utilities/MonoGamePlatform.cs +++ b/MonoGame.Framework/Utilities/MonoGamePlatform.cs @@ -43,6 +43,16 @@ public enum MonoGamePlatform /// MonoGame Xbox One platform. /// XboxOne, + + /// + /// MonoGame Windows GDK platform. + /// + WindowsGDK, + + /// + /// MonoGame Xbox Series platform. + /// + XboxSeries, /// /// MonoGame PlayStation 4 platform. diff --git a/Tools/MonoGame.Effect.Compiler/MonoGame.Effect.Compiler.csproj b/Tools/MonoGame.Effect.Compiler/MonoGame.Effect.Compiler.csproj index 00ccca6da08..2d5eb5a0e74 100644 --- a/Tools/MonoGame.Effect.Compiler/MonoGame.Effect.Compiler.csproj +++ b/Tools/MonoGame.Effect.Compiler/MonoGame.Effect.Compiler.csproj @@ -83,6 +83,7 @@ +