diff --git a/MonoGame.Framework.Native.sln b/MonoGame.Framework.Native.sln new file mode 100644 index 00000000000..f6dc6f70026 --- /dev/null +++ b/MonoGame.Framework.Native.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Framework.Native", "MonoGame.Framework\MonoGame.Framework.Native.csproj", "{56BA741D-6AF1-489B-AB00-338DE11B1D32}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {56BA741D-6AF1-489B-AB00-338DE11B1D32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {56BA741D-6AF1-489B-AB00-338DE11B1D32}.Debug|Any CPU.Build.0 = Debug|Any CPU + {56BA741D-6AF1-489B-AB00-338DE11B1D32}.Release|Any CPU.ActiveCfg = Release|Any CPU + {56BA741D-6AF1-489B-AB00-338DE11B1D32}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/MonoGame.Framework/Graphics/SamplerStateCollection.cs b/MonoGame.Framework/Graphics/SamplerStateCollection.cs index a2ca1e5bde4..d0a8817af58 100644 --- a/MonoGame.Framework/Graphics/SamplerStateCollection.cs +++ b/MonoGame.Framework/Graphics/SamplerStateCollection.cs @@ -1,8 +1,6 @@ // MonoGame - Copyright (C) MonoGame Foundation, Inc // This file is subject to the terms and conditions defined in // file 'LICENSE.txt', which is part of this source code package. -// -// Author: Kenneth James Pouncey using System; @@ -40,15 +38,15 @@ internal SamplerStateCollection(GraphicsDevice device, int maxSamplers, bool app Clear(); } - - public SamplerState this [int index] + + public SamplerState this [int index] { - get - { - return _samplers[index]; + get + { + return _samplers[index]; } - set + set { if (value == null) throw new ArgumentNullException("value"); diff --git a/MonoGame.Framework/Media/AlbumCollection.cs b/MonoGame.Framework/Media/AlbumCollection.cs index be4e3fdb966..7330aa0f97e 100644 --- a/MonoGame.Framework/Media/AlbumCollection.cs +++ b/MonoGame.Framework/Media/AlbumCollection.cs @@ -26,6 +26,8 @@ namespace Microsoft.Xna.Framework.Media /// public sealed class AlbumCollection : IDisposable { + public static readonly AlbumCollection Empty = new AlbumCollection(new List()); + private List albumCollection; /// diff --git a/MonoGame.Framework/Media/MediaQueue.cs b/MonoGame.Framework/Media/MediaQueue.cs index 534c65ed571..c9d23c6fc93 100644 --- a/MonoGame.Framework/Media/MediaQueue.cs +++ b/MonoGame.Framework/Media/MediaQueue.cs @@ -15,20 +15,20 @@ public sealed class MediaQueue public MediaQueue() { - + } - + public Song ActiveSong { get { if (songs.Count == 0 || _activeSongIndex < 0) return null; - + return songs[_activeSongIndex]; } } - + public int ActiveSongIndex { get @@ -69,26 +69,26 @@ internal Song GetNextSong(int direction, bool shuffle) { if (shuffle) _activeSongIndex = random.Next(songs.Count); - else + else _activeSongIndex = (int)MathHelper.Clamp(_activeSongIndex + direction, 0, songs.Count - 1); - + return songs[_activeSongIndex]; } - + internal void Clear() { Song song; for(; songs.Count > 0; ) { song = songs[0]; -#if !DIRECTX +#if !DIRECTX && !NATIVE song.Stop(); #endif songs.Remove(song); - } + } } -#if !DIRECTX +#if !DIRECTX && !NATIVE internal void SetVolume(float volume) { int count = songs.Count; @@ -102,7 +102,7 @@ internal void Add(Song song) songs.Add(song); } -#if !DIRECTX +#if !DIRECTX && !NATIVE internal void Stop() { int count = songs.Count; diff --git a/MonoGame.Framework/Media/SongCollection.cs b/MonoGame.Framework/Media/SongCollection.cs index 525b4a38b9b..f41da5d79fa 100644 --- a/MonoGame.Framework/Media/SongCollection.cs +++ b/MonoGame.Framework/Media/SongCollection.cs @@ -5,11 +5,13 @@ using System; using System.Collections; using System.Collections.Generic; - -namespace Microsoft.Xna.Framework.Media -{ - public class SongCollection : ICollection, IEnumerable, IEnumerable, IDisposable - { + +namespace Microsoft.Xna.Framework.Media +{ + public class SongCollection : ICollection, IEnumerable, IEnumerable, IDisposable + { + public static readonly SongCollection Empty = new SongCollection(); + private bool isReadOnly = false; private List innerlist = new List(); @@ -26,12 +28,12 @@ internal SongCollection(List songs) public void Dispose() { } - + public IEnumerator GetEnumerator() { return innerlist.GetEnumerator(); } - + IEnumerator IEnumerable.GetEnumerator() { return innerlist.GetEnumerator(); @@ -44,7 +46,7 @@ public int Count return innerlist.Count; } } - + public bool IsReadOnly { get @@ -60,7 +62,7 @@ public Song this[int index] return this.innerlist[index]; } } - + public void Add(Song item) { @@ -84,12 +86,12 @@ public void Add(Song item) this.innerlist.Add(item); } - + public void Clear() { innerlist.Clear(); } - + public SongCollection Clone() { SongCollection sc = new SongCollection(); @@ -97,26 +99,26 @@ public SongCollection Clone() sc.Add(song); return sc; } - + public bool Contains(Song item) { return innerlist.Contains(item); } - + public void CopyTo(Song[] array, int arrayIndex) { innerlist.CopyTo(array, arrayIndex); } - + public int IndexOf(Song item) { return innerlist.IndexOf(item); } - + public bool Remove(Song item) { return innerlist.Remove(item); - } - } -} - + } + } +} + diff --git a/MonoGame.Framework/MonoGame.Framework.Native.csproj b/MonoGame.Framework/MonoGame.Framework.Native.csproj new file mode 100644 index 00000000000..2cbd340c354 --- /dev/null +++ b/MonoGame.Framework/MonoGame.Framework.Native.csproj @@ -0,0 +1,26 @@ + + + + net8.0 + XNADESIGNPROVIDED;NATIVE;SUPPORTS_EFX;NETSTANDARD;STBSHARP_INTERNAL + true + The MonoGame Native platform. + monogame;.net core;core;.net standard;standard;native + MonoGame.Framework.Native + False + True + + + + + + + + + + + + + + + diff --git a/MonoGame.Framework/Platform/Native/ConstantBuffer.Native.cs b/MonoGame.Framework/Platform/Native/ConstantBuffer.Native.cs new file mode 100644 index 00000000000..509b51b4522 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/ConstantBuffer.Native.cs @@ -0,0 +1,23 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +internal partial class ConstantBuffer +{ + private void PlatformInitialize() + { + + } + + private void PlatformClear() + { + + } + + internal void PlatformApply(GraphicsDevice device, ShaderStage stage, int slot) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/DepthStencilState.Native.cs b/MonoGame.Framework/Platform/Native/DepthStencilState.Native.cs new file mode 100644 index 00000000000..b7618f0d876 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/DepthStencilState.Native.cs @@ -0,0 +1,13 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +public partial class DepthStencilState +{ + internal void PlatformApplyState(GraphicsDevice device) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/DynamicSoundEffectInstance.Native.cs b/MonoGame.Framework/Platform/Native/DynamicSoundEffectInstance.Native.cs new file mode 100644 index 00000000000..30c5496cb69 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/DynamicSoundEffectInstance.Native.cs @@ -0,0 +1,45 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Audio; + +public sealed partial class DynamicSoundEffectInstance : SoundEffectInstance +{ + private void PlatformCreate() + { + } + + private int PlatformGetPendingBufferCount() + { + return 0; + } + + private void PlatformPlay() + { + } + + private void PlatformPause() + { + } + + private void PlatformResume() + { + } + + private void PlatformStop() + { + } + + private void PlatformSubmitBuffer(byte[] buffer, int offset, int count) + { + } + + private void PlatformDispose(bool disposing) + { + } + + private void PlatformUpdateQueue() + { + } +} diff --git a/MonoGame.Framework/Platform/Native/EffectResource.Native.cs b/MonoGame.Framework/Platform/Native/EffectResource.Native.cs new file mode 100644 index 00000000000..d4f1ec39795 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/EffectResource.Native.cs @@ -0,0 +1,16 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +internal partial class EffectResource +{ + // TODO: These should be loaded from the native library and not from the C# embedded resources! + const string AlphaTestEffectName = "Microsoft.Xna.Framework.Platform.Graphics.Effect.Resources.AlphaTestEffect.ogl.mgfxo"; + const string BasicEffectName = "Microsoft.Xna.Framework.Platform.Graphics.Effect.Resources.BasicEffect.ogl.mgfxo"; + const string DualTextureEffectName = "Microsoft.Xna.Framework.Platform.Graphics.Effect.Resources.DualTextureEffect.ogl.mgfxo"; + const string EnvironmentMapEffectName = "Microsoft.Xna.Framework.Platform.Graphics.Effect.Resources.EnvironmentMapEffect.ogl.mgfxo"; + const string SkinnedEffectName = "Microsoft.Xna.Framework.Platform.Graphics.Effect.Resources.SkinnedEffect.ogl.mgfxo"; + const string SpriteEffectName = "Microsoft.Xna.Framework.Platform.Graphics.Effect.Resources.SpriteEffect.ogl.mgfxo"; +} diff --git a/MonoGame.Framework/Platform/Native/GamePad.Native.cs b/MonoGame.Framework/Platform/Native/GamePad.Native.cs new file mode 100644 index 00000000000..28298bad659 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/GamePad.Native.cs @@ -0,0 +1,28 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Input; + +static partial class GamePad +{ + private static int PlatformGetMaxNumberOfGamePads() + { + return 16; + } + + private static GamePadCapabilities PlatformGetCapabilities(int index) + { + return new GamePadCapabilities(); + } + + private static GamePadState PlatformGetState(int index, GamePadDeadZone leftDeadZoneMode, GamePadDeadZone rightDeadZoneMode) + { + return new GamePadState(); + } + + private static bool PlatformSetVibration(int index, float leftMotor, float rightMotor, float leftTrigger, float rightTrigger) + { + return false; + } +} diff --git a/MonoGame.Framework/Platform/Native/GamePlatform.Native.cs b/MonoGame.Framework/Platform/Native/GamePlatform.Native.cs new file mode 100644 index 00000000000..ffedce44e26 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/GamePlatform.Native.cs @@ -0,0 +1,64 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework; + +partial class GamePlatform +{ + internal static GamePlatform PlatformCreate(Game game) => new NativeGamePlatform(game); +} + +class NativeGamePlatform : GamePlatform +{ + public NativeGamePlatform(Game game) : base(game) + { + } + + public override GameRunBehavior DefaultRunBehavior { get; } + + public override void Exit() + { + + } + + public override void RunLoop() + { + + } + + public override void StartRunLoop() + { + + } + + public override bool BeforeUpdate(GameTime gameTime) + { + return false; + } + + public override bool BeforeDraw(GameTime gameTime) + { + return false; + } + + public override void EnterFullScreen() + { + + } + + public override void ExitFullScreen() + { + + } + + public override void BeginScreenDeviceChange(bool willBeFullScreen) + { + + } + + public override void EndScreenDeviceChange(string screenDeviceName, int clientWidth, int clientHeight) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/GameWindow.Native.cs b/MonoGame.Framework/Platform/Native/GameWindow.Native.cs new file mode 100644 index 00000000000..bd0ce5dbe97 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/GameWindow.Native.cs @@ -0,0 +1,36 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System; + +namespace Microsoft.Xna.Framework; + +internal class NativeGameWindow : GameWindow +{ + public override bool AllowUserResizing { get; set; } + public override Rectangle ClientBounds { get; } + public override DisplayOrientation CurrentOrientation { get; } + public override IntPtr Handle { get; } + public override string ScreenDeviceName { get; } + + public override void BeginScreenDeviceChange(bool willBeFullScreen) + { + + } + + public override void EndScreenDeviceChange(string screenDeviceName, int clientWidth, int clientHeight) + { + + } + + protected internal override void SetSupportedOrientations(DisplayOrientation orientations) + { + + } + + protected override void SetTitle(string title) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/GraphicsAdapter.Native.cs b/MonoGame.Framework/Platform/Native/GraphicsAdapter.Native.cs new file mode 100644 index 00000000000..406af5430df --- /dev/null +++ b/MonoGame.Framework/Platform/Native/GraphicsAdapter.Native.cs @@ -0,0 +1,20 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System.Collections.ObjectModel; + +namespace Microsoft.Xna.Framework.Graphics; + +partial class GraphicsAdapter +{ + private static void PlatformInitializeAdapters(out ReadOnlyCollection adapters) + { + adapters = new ReadOnlyCollection([]); + } + + private bool PlatformIsProfileSupported(GraphicsProfile graphicsProfile) + { + return false; + } +} diff --git a/MonoGame.Framework/Platform/Native/GraphicsCapabilities.Native.cs b/MonoGame.Framework/Platform/Native/GraphicsCapabilities.Native.cs new file mode 100644 index 00000000000..30843102a30 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/GraphicsCapabilities.Native.cs @@ -0,0 +1,14 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +internal partial class GraphicsCapabilities +{ + private void PlatformInitialize(GraphicsDevice device) + { + + } + +} diff --git a/MonoGame.Framework/Platform/Native/GraphicsDebug.Native.cs b/MonoGame.Framework/Platform/Native/GraphicsDebug.Native.cs new file mode 100644 index 00000000000..24f3116a1ed --- /dev/null +++ b/MonoGame.Framework/Platform/Native/GraphicsDebug.Native.cs @@ -0,0 +1,14 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +public partial class GraphicsDebug +{ + private bool PlatformTryDequeueMessage(out GraphicsDebugMessage message) + { + message = null; + return false; + } +} diff --git a/MonoGame.Framework/Platform/Native/GraphicsDevice.Native.cs b/MonoGame.Framework/Platform/Native/GraphicsDevice.Native.cs new file mode 100644 index 00000000000..83fd2716981 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/GraphicsDevice.Native.cs @@ -0,0 +1,100 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System; + +namespace Microsoft.Xna.Framework.Graphics; + +public partial class GraphicsDevice +{ + private void PlatformSetup() + { + + } + + private void PlatformInitialize() + { + } + + private void OnPresentationChanged() + { + } + + private void PlatformClear(ClearOptions options, Vector4 color, float depth, int stencil) + { + + } + + private void PlatformDispose() + { + } + + private void PlatformPresent() + { + } + + private void PlatformSetViewport(ref Viewport value) + { + } + + private void PlatformApplyDefaultRenderTarget() + { + } + + private void PlatformResolveRenderTargets() + { + // Resolving MSAA render targets should be done here. + } + + private IRenderTarget PlatformApplyRenderTargets() + { + return null; + } + + private void PlatformBeginApplyState() + { + } + + private void PlatformApplyBlend() + { + } + + private void PlatformApplyState(bool applyShaders) + { + } + + private void PlatformDrawIndexedPrimitives(PrimitiveType primitiveType, int baseVertex, int startIndex, int primitiveCount) + { + } + + private void PlatformDrawUserPrimitives(PrimitiveType primitiveType, T[] vertexData, int vertexOffset, VertexDeclaration vertexDeclaration, int vertexCount) where T : struct + { + } + + private void PlatformDrawPrimitives(PrimitiveType primitiveType, int vertexStart, int vertexCount) + { + } + + private void PlatformDrawUserIndexedPrimitives(PrimitiveType primitiveType, T[] vertexData, int vertexOffset, int numVertices, short[] indexData, int indexOffset, int primitiveCount, VertexDeclaration vertexDeclaration) where T : struct + { + } + + private void PlatformDrawUserIndexedPrimitives(PrimitiveType primitiveType, T[] vertexData, int vertexOffset, int numVertices, int[] indexData, int indexOffset, int primitiveCount, VertexDeclaration vertexDeclaration) where T : struct + { + } + + private void PlatformDrawInstancedPrimitives(PrimitiveType primitiveType, int baseVertex, int startIndex, int primitiveCount, int baseInstance, int instanceCount) + { + } + + private void PlatformGetBackBufferData(Rectangle? rect, T[] data, int startIndex, int count) where T : struct + { + throw new NotImplementedException(); + } + + private static Rectangle PlatformGetTitleSafeArea(int x, int y, int width, int height) + { + return new Rectangle(x, y, width, height); + } +} diff --git a/MonoGame.Framework/Platform/Native/IndexBuffer.Native.cs b/MonoGame.Framework/Platform/Native/IndexBuffer.Native.cs new file mode 100644 index 00000000000..f530cf38eb6 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/IndexBuffer.Native.cs @@ -0,0 +1,28 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +public partial class IndexBuffer +{ + private void PlatformConstruct(IndexElementSize indexElementSize, int indexCount) + { + + } + + private void PlatformGraphicsDeviceResetting() + { + + } + + private void PlatformGetData(int offsetInBytes, T[] data, int startIndex, int elementCount) where T : struct + { + + } + + private void PlatformSetData(int offsetInBytes, T[] data, int startIndex, int elementCount, SetDataOptions options) where T : struct + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/Joystick.Native.cs b/MonoGame.Framework/Platform/Native/Joystick.Native.cs new file mode 100644 index 00000000000..cb6dbd980f5 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/Joystick.Native.cs @@ -0,0 +1,41 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Input; + +static partial class Joystick +{ + private const bool PlatformIsSupported = false; + + private static JoystickCapabilities PlatformGetCapabilities(int index) + { + return new JoystickCapabilities() + { + IsConnected = false, + DisplayName = string.Empty, + IsGamepad = false, + AxisCount = 0, + ButtonCount = 0, + HatCount = 0 + }; + } + + private static JoystickState PlatformGetState(int index) + { + return _defaultJoystickState; + } + + private static int PlatformLastConnectedIndex + { + get + { + return -1; + } + } + + private static void PlatformGetState(ref JoystickState joystickState, int index) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/Keyboard.Native.cs b/MonoGame.Framework/Platform/Native/Keyboard.Native.cs new file mode 100644 index 00000000000..57a0a4a12a2 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/Keyboard.Native.cs @@ -0,0 +1,13 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Input; + +public static partial class Keyboard +{ + private static KeyboardState PlatformGetState() + { + return new KeyboardState(); + } +} diff --git a/MonoGame.Framework/Platform/Native/KeyboardInput.Native.cs b/MonoGame.Framework/Platform/Native/KeyboardInput.Native.cs new file mode 100644 index 00000000000..6847d16480c --- /dev/null +++ b/MonoGame.Framework/Platform/Native/KeyboardInput.Native.cs @@ -0,0 +1,20 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System.Threading.Tasks; + +namespace Microsoft.Xna.Framework.Input; + +public static partial class KeyboardInput +{ + private static Task PlatformShow(string title, string description, string defaultText, bool usePasswordMode) + { + return Task.FromResult(""); + } + + private static void PlatformCancel(string result) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/MediaLibrary.Native.cs b/MonoGame.Framework/Platform/Native/MediaLibrary.Native.cs new file mode 100644 index 00000000000..16529939fe2 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/MediaLibrary.Native.cs @@ -0,0 +1,18 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System; + +namespace Microsoft.Xna.Framework.Media; + +public partial class MediaLibrary +{ + private void PlatformLoad(Action progressCallback) { } + + private AlbumCollection PlatformGetAlbums() => AlbumCollection.Empty; + + private SongCollection PlatformGetSongs() => SongCollection.Empty; + + private void PlatformDispose() { } +} diff --git a/MonoGame.Framework/Platform/Native/MediaPlayer.Native.cs b/MonoGame.Framework/Platform/Native/MediaPlayer.Native.cs new file mode 100644 index 00000000000..caf2d63d8b2 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/MediaPlayer.Native.cs @@ -0,0 +1,90 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System; + +namespace Microsoft.Xna.Framework.Media; + +public static partial class MediaPlayer +{ + private static void PlatformInitialize() + { + + } + + private static bool PlatformGetIsMuted() + { + return false; + } + + private static void PlatformSetIsMuted(bool muted) + { + + } + + private static bool PlatformGetIsRepeating() + { + return false; + } + + private static void PlatformSetIsRepeating(bool repeating) + { + + } + + private static bool PlatformGetIsShuffled() + { + return false; + } + + private static void PlatformSetIsShuffled(bool shuffled) + { + + } + + private static TimeSpan PlatformGetPlayPosition() + { + return TimeSpan.Zero; + } + + private static MediaState PlatformGetState() + { + return MediaState.Stopped; + } + + private static float PlatformGetVolume() + { + return 0.0f; + } + + private static void PlatformSetVolume(float volume) + { + + } + + private static bool PlatformGetGameHasControl() + { + return false; + } + + private static void PlatformPause() + { + + } + + private static void PlatformPlaySong(Song song, TimeSpan? startPosition) + { + + } + + private static void PlatformResume() + { + + } + + private static void PlatformStop() + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/MessageBox.Native.cs b/MonoGame.Framework/Platform/Native/MessageBox.Native.cs new file mode 100644 index 00000000000..b47160ebdcc --- /dev/null +++ b/MonoGame.Framework/Platform/Native/MessageBox.Native.cs @@ -0,0 +1,21 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Microsoft.Xna.Framework.Input; + +public static partial class MessageBox +{ + private static Task PlatformShow(string title, string description, List buttons) + { + return Task.FromResult(0); + } + + private static void PlatformCancel(int? result) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/Microphone.Native.cs b/MonoGame.Framework/Platform/Native/Microphone.Native.cs new file mode 100644 index 00000000000..ed3696f22bb --- /dev/null +++ b/MonoGame.Framework/Platform/Native/Microphone.Native.cs @@ -0,0 +1,28 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Audio; + +public sealed partial class Microphone +{ + private void PlatformStart() + { + + } + + private void PlatformStop() + { + + } + + private void Update() + { + + } + + private int PlatformGetData(byte[] buffer, int offset, int count) + { + return 0; + } +} diff --git a/MonoGame.Framework/Platform/Native/Mouse.Native.cs b/MonoGame.Framework/Platform/Native/Mouse.Native.cs new file mode 100644 index 00000000000..266b4c5854b --- /dev/null +++ b/MonoGame.Framework/Platform/Native/Mouse.Native.cs @@ -0,0 +1,35 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System; + +namespace Microsoft.Xna.Framework.Input; + +public static partial class Mouse +{ + private static IntPtr PlatformGetWindowHandle() + { + return IntPtr.Zero; + } + + private static void PlatformSetWindowHandle(IntPtr windowHandle) + { + + } + + private static MouseState PlatformGetState(GameWindow window) + { + return window.MouseState; + } + + private static void PlatformSetPosition(int x, int y) + { + + } + + public static void PlatformSetCursor(MouseCursor cursor) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/MouseCursor.Nativve.cs b/MonoGame.Framework/Platform/Native/MouseCursor.Nativve.cs new file mode 100644 index 00000000000..15e01e57a8f --- /dev/null +++ b/MonoGame.Framework/Platform/Native/MouseCursor.Nativve.cs @@ -0,0 +1,26 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System; +using Microsoft.Xna.Framework.Graphics; + +namespace Microsoft.Xna.Framework.Input; + +public partial class MouseCursor +{ + private static void PlatformInitalize() + { + + } + + private static MouseCursor PlatformFromTexture2D(Texture2D texture, int originx, int originy) + { + return new MouseCursor(IntPtr.Zero); + } + + private void PlatformDispose() + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/OcclusionQuery.Native.cs b/MonoGame.Framework/Platform/Native/OcclusionQuery.Native.cs new file mode 100644 index 00000000000..f57a07f84fe --- /dev/null +++ b/MonoGame.Framework/Platform/Native/OcclusionQuery.Native.cs @@ -0,0 +1,26 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +partial class OcclusionQuery +{ + private void PlatformConstruct() + { + } + + private void PlatformBegin() + { + } + + private void PlatformEnd() + { + } + + private bool PlatformGetResult(out int pixelCount) + { + pixelCount = 0; + return false; + } +} diff --git a/MonoGame.Framework/Platform/Native/PlatformInfo.Native.cs b/MonoGame.Framework/Platform/Native/PlatformInfo.Native.cs new file mode 100644 index 00000000000..e82b9c15dba --- /dev/null +++ b/MonoGame.Framework/Platform/Native/PlatformInfo.Native.cs @@ -0,0 +1,18 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace MonoGame.Framework.Utilities; + +public static partial class PlatformInfo +{ + private static MonoGamePlatform PlatformGetMonoGamePlatform() + { + return MonoGamePlatform.DesktopGL; + } + + private static GraphicsBackend PlatformGetGraphicsBackend() + { + return GraphicsBackend.OpenGL; + } +} diff --git a/MonoGame.Framework/Platform/Native/RasterizerState.Native.cs b/MonoGame.Framework/Platform/Native/RasterizerState.Native.cs new file mode 100644 index 00000000000..f1d4b5e2734 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/RasterizerState.Native.cs @@ -0,0 +1,13 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +public partial class RasterizerState +{ + internal void PlatformApplyState(GraphicsDevice device) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/ReflectionHelper.Native.cs b/MonoGame.Framework/Platform/Native/ReflectionHelper.Native.cs new file mode 100644 index 00000000000..dfc12953fbf --- /dev/null +++ b/MonoGame.Framework/Platform/Native/ReflectionHelper.Native.cs @@ -0,0 +1,31 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System; +using System.Runtime.InteropServices; + +namespace MonoGame.Framework.Utilities; + +internal static partial class ReflectionHelpers +{ + internal static class SizeOf + { + static int _sizeOf; + + static SizeOf() + { + _sizeOf = Marshal.SizeOf(); + } + + public static int Get() + { + return _sizeOf; + } + } + + internal static int ManagedSizeOf(Type type) + { + return Marshal.SizeOf(type); + } +} diff --git a/MonoGame.Framework/Platform/Native/RenderTarget2D.Native.cs b/MonoGame.Framework/Platform/Native/RenderTarget2D.Native.cs new file mode 100644 index 00000000000..58ccdf165a5 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/RenderTarget2D.Native.cs @@ -0,0 +1,18 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +public partial class RenderTarget2D +{ + private void PlatformConstruct(GraphicsDevice graphicsDevice, int width, int height, bool mipMap, DepthFormat preferredDepthFormat, int preferredMultiSampleCount, RenderTargetUsage usage, bool shared) + { + + } + + private void PlatformGraphicsDeviceResetting() + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/RenderTarget3D.Native.cs b/MonoGame.Framework/Platform/Native/RenderTarget3D.Native.cs new file mode 100644 index 00000000000..d2c8389de90 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/RenderTarget3D.Native.cs @@ -0,0 +1,13 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +public partial class RenderTarget3D +{ + private void PlatformConstruct(GraphicsDevice graphicsDevice, int width, int height, bool mipMap, DepthFormat preferredDepthFormat, int preferredMultiSampleCount, RenderTargetUsage usage) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/RenderTargetCube.Native.cs b/MonoGame.Framework/Platform/Native/RenderTargetCube.Native.cs new file mode 100644 index 00000000000..e64d10b0bcd --- /dev/null +++ b/MonoGame.Framework/Platform/Native/RenderTargetCube.Native.cs @@ -0,0 +1,13 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +public partial class RenderTargetCube +{ + private void PlatformConstruct(GraphicsDevice graphicsDevice, bool mipMap, DepthFormat preferredDepthFormat, int preferredMultiSampleCount, RenderTargetUsage usage) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/SamplerStateCollection.Native.cs b/MonoGame.Framework/Platform/Native/SamplerStateCollection.Native.cs new file mode 100644 index 00000000000..b9b59b77701 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/SamplerStateCollection.Native.cs @@ -0,0 +1,25 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +public sealed partial class SamplerStateCollection +{ + private void PlatformSetSamplerState(int index) + { + } + + private void PlatformClear() + { + } + + private void PlatformDirty() + { + } + + private void PlatformSetSamplers(GraphicsDevice device) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/Shader.Native.cs b/MonoGame.Framework/Platform/Native/Shader.Native.cs new file mode 100644 index 00000000000..1a6d03d5af2 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/Shader.Native.cs @@ -0,0 +1,23 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +partial class Shader +{ + private static int PlatformProfile() + { + return 0; + } + + private void PlatformConstruct(ShaderStage stage, byte[] shaderBytecode) + { + + } + + private void PlatformGraphicsDeviceResetting() + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/Song.Native.cs b/MonoGame.Framework/Platform/Native/Song.Native.cs new file mode 100644 index 00000000000..bedda5aa798 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/Song.Native.cs @@ -0,0 +1,70 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System; + +namespace Microsoft.Xna.Framework.Media; + +public sealed partial class Song : IEquatable, IDisposable +{ + private void PlatformInitialize(string fileName) + { + + } + + private void PlatformDispose(bool disposing) + { + + } + + private Album PlatformGetAlbum() + { + return null; + } + + private Artist PlatformGetArtist() + { + return null; + } + + private Genre PlatformGetGenre() + { + return null; + } + + private TimeSpan PlatformGetDuration() + { + return TimeSpan.Zero; + } + + private bool PlatformIsProtected() + { + return false; + } + + private bool PlatformIsRated() + { + return false; + } + + private string PlatformGetName() + { + return ""; + } + + private int PlatformGetPlayCount() + { + return 0; + } + + private int PlatformGetRating() + { + return 0; + } + + private int PlatformGetTrackNumber() + { + return 0; + } +} diff --git a/MonoGame.Framework/Platform/Native/SoundEffect.Native.cs b/MonoGame.Framework/Platform/Native/SoundEffect.Native.cs new file mode 100644 index 00000000000..dc021d124d7 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/SoundEffect.Native.cs @@ -0,0 +1,58 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System; +using System.IO; + +namespace Microsoft.Xna.Framework.Audio; + +public sealed partial class SoundEffect +{ + internal const int MAX_PLAYING_INSTANCES = int.MaxValue; + + private void PlatformLoadAudioStream(Stream s, out TimeSpan duration) + { + duration = TimeSpan.Zero; + } + + private void PlatformInitializePcm(byte[] buffer, int offset, int count, int sampleBits, int sampleRate, AudioChannels channels, int loopStart, int loopLength) + { + + } + + private void PlatformInitializeFormat(byte[] header, byte[] buffer, int bufferSize, int loopStart, int loopLength) + { + + } + + private void PlatformInitializeXact(MiniFormatTag codec, byte[] buffer, int channels, int sampleRate, int blockAlignment, int loopStart, int loopLength, out TimeSpan duration) + { + duration = TimeSpan.Zero; + } + + private void PlatformSetupInstance(SoundEffectInstance instance) + { + + } + + private void PlatformDispose(bool disposing) + { + + } + + internal static void PlatformSetReverbSettings(ReverbSettings reverbSettings) + { + + } + + private static void PlatformInitialize() + { + + } + + internal static void PlatformShutdown() + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/SoundEffectInstance.Native.cs b/MonoGame.Framework/Platform/Native/SoundEffectInstance.Native.cs new file mode 100644 index 00000000000..337f2033a22 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/SoundEffectInstance.Native.cs @@ -0,0 +1,90 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System; + +namespace Microsoft.Xna.Framework.Audio; + +public partial class SoundEffectInstance : IDisposable +{ + private void PlatformInitialize(byte[] buffer, int sampleRate, int channels) + { + + } + + private void PlatformApply3D(AudioListener listener, AudioEmitter emitter) + { + + } + + private void PlatformPause() + { + + } + + private void PlatformPlay() + { + + } + + private void PlatformResume() + { + + } + + private void PlatformStop(bool immediate) + { + + } + + private void PlatformSetIsLooped(bool value) + { + + } + + private bool PlatformGetIsLooped() + { + return false; + } + + private void PlatformSetPan(float value) + { + + } + + private void PlatformSetPitch(float value) + { + + } + + private SoundState PlatformGetState() + { + return SoundState.Stopped; + } + + private void PlatformSetVolume(float value) + { + + } + + internal void PlatformSetReverbMix(float mix) + { + + } + + internal void PlatformSetFilter(FilterMode mode, float filterQ, float frequency) + { + + } + + internal void PlatformClearFilter() + { + + } + + private void PlatformDispose(bool disposing) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/Texture.Native.cs b/MonoGame.Framework/Platform/Native/Texture.Native.cs new file mode 100644 index 00000000000..8bbcdad4e26 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/Texture.Native.cs @@ -0,0 +1,13 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +public abstract partial class Texture +{ + private void PlatformGraphicsDeviceResetting() + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/Texture2D.Native.cs b/MonoGame.Framework/Platform/Native/Texture2D.Native.cs new file mode 100644 index 00000000000..3ddeb1f0e69 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/Texture2D.Native.cs @@ -0,0 +1,56 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System; +using System.IO; + +namespace Microsoft.Xna.Framework.Graphics; + +public partial class Texture2D : Texture +{ + private void PlatformConstruct(int width, int height, bool mipmap, SurfaceFormat format, SurfaceType type, bool shared) + { + + } + + private void PlatformSetData(int level, T[] data, int startIndex, int elementCount) where T : struct + { + + } + + private void PlatformSetData(int level, int arraySlice, Rectangle rect, T[] data, int startIndex, int elementCount) where T : struct + { + + } + + private void PlatformGetData(int level, int arraySlice, Rectangle rect, T[] data, int startIndex, int elementCount) where T : struct + { + + } + + private static Texture2D PlatformFromStream(GraphicsDevice graphicsDevice, Stream stream) + { + return new Texture2D(graphicsDevice, 1, 1); + } + + private static Texture2D PlatformFromStream(GraphicsDevice graphicsDevice, Stream stream, Action colorProcessor) + { + return new Texture2D(graphicsDevice, 1, 1); + } + + private void PlatformSaveAsJpeg(Stream stream, int width, int height) + { + + } + + private void PlatformSaveAsPng(Stream stream, int width, int height) + { + + } + + private void PlatformReload(Stream textureStream) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/Texture3D.Native.cs b/MonoGame.Framework/Platform/Native/Texture3D.Native.cs new file mode 100644 index 00000000000..d6b072ae57a --- /dev/null +++ b/MonoGame.Framework/Platform/Native/Texture3D.Native.cs @@ -0,0 +1,23 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +public partial class Texture3D : Texture +{ + private void PlatformConstruct(GraphicsDevice graphicsDevice, int width, int height, int depth, bool mipMap, SurfaceFormat format, bool renderTarget) + { + + } + + private void PlatformSetData(int level, int left, int top, int right, int bottom, int front, int back, T[] data, int startIndex, int elementCount, int width, int height, int depth) + { + + } + + private void PlatformGetData(int level, int left, int top, int right, int bottom, int front, int back, T[] data, int startIndex, int elementCount) where T : struct + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/TextureCollection.Native.cs b/MonoGame.Framework/Platform/Native/TextureCollection.Native.cs new file mode 100644 index 00000000000..df2a7ca05c5 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/TextureCollection.Native.cs @@ -0,0 +1,23 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +public sealed partial class TextureCollection +{ + private void PlatformInit() + { + + } + + private void PlatformClear() + { + + } + + private void PlatformSetTextures(GraphicsDevice device) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/TextureCube.Native.cs b/MonoGame.Framework/Platform/Native/TextureCube.Native.cs new file mode 100644 index 00000000000..7db76ec874b --- /dev/null +++ b/MonoGame.Framework/Platform/Native/TextureCube.Native.cs @@ -0,0 +1,23 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +public partial class TextureCube +{ + private void PlatformConstruct(GraphicsDevice graphicsDevice, int size, bool mipMap, SurfaceFormat format, bool renderTarget) + { + + } + + private void PlatformGetData(CubeMapFace cubeMapFace, int level, Rectangle rect, T[] data, int startIndex, int elementCount) where T : struct + { + + } + + private void PlatformSetData(CubeMapFace face, int level, Rectangle rect, T[] data, int startIndex, int elementCount) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/TitleContainer.Native.cs b/MonoGame.Framework/Platform/Native/TitleContainer.Native.cs new file mode 100644 index 00000000000..e7edbaf8d4c --- /dev/null +++ b/MonoGame.Framework/Platform/Native/TitleContainer.Native.cs @@ -0,0 +1,20 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System.IO; + +namespace Microsoft.Xna.Framework; + +partial class TitleContainer +{ + static partial void PlatformInit() + { + + } + + private static Stream PlatformOpenStream(string safeName) + { + return Stream.Null; + } +} diff --git a/MonoGame.Framework/Platform/Native/VertexBuffer.Native.cs b/MonoGame.Framework/Platform/Native/VertexBuffer.Native.cs new file mode 100644 index 00000000000..a7c0612a48e --- /dev/null +++ b/MonoGame.Framework/Platform/Native/VertexBuffer.Native.cs @@ -0,0 +1,28 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Graphics; + +public partial class VertexBuffer +{ + private void PlatformConstruct() + { + + } + + private void PlatformGetData(int offsetInBytes, T[] data, int startIndex, int elementCount, int vertexStride) + { + + } + + private void PlatformSetData(int offsetInBytes, T[] data, int startIndex, int elementCount, int vertexStride, SetDataOptions options, int bufferSize, int elementSizeInBytes) + { + + } + + private void PlatformGraphicsDeviceResetting() + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/Video.Native.cs b/MonoGame.Framework/Platform/Native/Video.Native.cs new file mode 100644 index 00000000000..05e19a7b850 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/Video.Native.cs @@ -0,0 +1,15 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System; + +namespace Microsoft.Xna.Framework.Media; + +public sealed partial class Video : IDisposable +{ + private void PlatformInitialize() + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/VideoPlayer.Native.cs b/MonoGame.Framework/Platform/Native/VideoPlayer.Native.cs new file mode 100644 index 00000000000..dfdfbf82433 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/VideoPlayer.Native.cs @@ -0,0 +1,70 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +using System; +using Microsoft.Xna.Framework.Graphics; + +namespace Microsoft.Xna.Framework.Media; + +public sealed partial class VideoPlayer : IDisposable +{ + private void PlatformInitialize() + { + + } + + private Texture2D PlatformGetTexture() + { + throw new NotImplementedException(); + } + + private void PlatformGetState(ref MediaState result) + { + } + + private void PlatformPause() + { + + } + + private void PlatformResume() + { + + } + + private void PlatformPlay() + { + + } + + private void PlatformStop() + { + + } + + private TimeSpan PlatformGetPlayPosition() + { + return TimeSpan.Zero; + } + + private void PlatformSetIsLooped() + { + + } + + private void PlatformSetIsMuted() + { + + } + + private TimeSpan PlatformSetVolume() + { + return TimeSpan.Zero; + } + + private void PlatformDispose(bool disposing) + { + + } +} diff --git a/MonoGame.Framework/Platform/Native/WaveBank.Native.cs b/MonoGame.Framework/Platform/Native/WaveBank.Native.cs new file mode 100644 index 00000000000..4506ba08761 --- /dev/null +++ b/MonoGame.Framework/Platform/Native/WaveBank.Native.cs @@ -0,0 +1,13 @@ +// MonoGame - Copyright (C) The MonoGame Team +// This file is subject to the terms and conditions defined in +// file 'LICENSE.txt', which is part of this source code package. + +namespace Microsoft.Xna.Framework.Audio; + +partial class WaveBank +{ + private SoundEffectInstance PlatformCreateStream(StreamInfo stream) + { + return new SoundEffectInstance(); + } +} diff --git a/MonoGame.Framework/Utilities/PlatformInfo.cs b/MonoGame.Framework/Utilities/PlatformInfo.cs index 2374f34745c..dfbbf3e7b37 100644 --- a/MonoGame.Framework/Utilities/PlatformInfo.cs +++ b/MonoGame.Framework/Utilities/PlatformInfo.cs @@ -7,7 +7,7 @@ namespace MonoGame.Framework.Utilities /// /// Utility class that returns information about the underlying platform /// - public static class PlatformInfo + public static partial class PlatformInfo { /// /// Underlying game platform type @@ -40,6 +40,8 @@ public static MonoGamePlatform MonoGamePlatform return MonoGamePlatform.PlayStation5; #elif STADIA return MonoGamePlatform.Stadia; +#else + return PlatformGetMonoGamePlatform(); #endif } } @@ -53,8 +55,10 @@ public static GraphicsBackend GraphicsBackend { #if DIRECTX return GraphicsBackend.DirectX; -#else +#elif OPENGL return GraphicsBackend.OpenGL; +#else + return PlatformGetGraphicsBackend(); #endif } } diff --git a/build.cake b/build.cake index f0522c25349..234ad9aaccf 100644 --- a/build.cake +++ b/build.cake @@ -144,6 +144,14 @@ Task("BuildConsoleCheck") DotNetBuild("MonoGame.Framework/MonoGame.Framework.ConsoleCheck.csproj"); }); +Task("BuildNative") + .IsDependentOn("Prep") + .Does(() => +{ + DotNetRestore("MonoGame.Framework/MonoGame.Framework.Native.csproj"); + PackDotnet("MonoGame.Framework/MonoGame.Framework.Native.csproj"); +}); + Task("BuildDesktopGL") .IsDependentOn("Prep") .Does(() => @@ -315,6 +323,7 @@ Task("SanityCheck") Task("BuildAll") .IsDependentOn("BuildConsoleCheck") + .IsDependentOn("BuildNative") .IsDependentOn("BuildDesktopGL") .IsDependentOn("BuildWindowsDX") .IsDependentOn("BuildAndroid")