Browse Source

Orientation updated to SDK and MG 3.8

CartBlanche 6 ngày trước cách đây
mục cha
commit
abbf564e2a
34 tập tin đã thay đổi với 629 bổ sung286 xóa
  1. 45 0
      Orientation/.vscode/launch.json
  2. 140 0
      Orientation/.vscode/tasks.json
  3. 0 34
      Orientation/Activity1.cs
  4. BIN
      Orientation/Assets/Content/Font.xnb
  5. 0 0
      Orientation/Core/Content/Background.png
  6. 32 0
      Orientation/Core/Content/Content.mgcb
  7. 1 1
      Orientation/Core/Content/Font.spritefont
  8. BIN
      Orientation/Core/Content/Font.xnb
  9. 0 0
      Orientation/Core/Content/GameThumbnail.png
  10. 0 0
      Orientation/Core/Content/Icon.ico
  11. 0 0
      Orientation/Core/Content/directions.png
  12. BIN
      Orientation/Core/Content/directions.xnb
  13. 2 15
      Orientation/Core/LayoutSample.cs
  14. 9 0
      Orientation/Core/Orientation.Core.csproj
  15. 9 20
      Orientation/Core/OrientationSample.cs
  16. 0 90
      Orientation/Orientation.Android.csproj
  17. 0 86
      Orientation/Orientation.iOS.csproj
  18. 48 0
      Orientation/Orientation.sln
  19. 31 0
      Orientation/Platforms/Android/AndroidManifest.xml
  20. 32 0
      Orientation/Platforms/Android/MainActivity.cs
  21. 17 0
      Orientation/Platforms/Android/Orientation.Android.csproj
  22. 0 0
      Orientation/Platforms/Android/Resources/Resource.designer.cs
  23. BIN
      Orientation/Platforms/Android/Resources/drawable/Icon.png
  24. 0 0
      Orientation/Platforms/Android/Resources/drawable/Splash.png
  25. 7 7
      Orientation/Platforms/Android/Resources/values/Styles.xml
  26. 17 0
      Orientation/Platforms/Desktop/Orientation.DesktopGL.csproj
  27. 13 0
      Orientation/Platforms/Desktop/Program.cs
  28. 19 0
      Orientation/Platforms/Windows/Orientation.Windows.csproj
  29. 14 0
      Orientation/Platforms/Windows/Program.cs
  30. 33 0
      Orientation/Platforms/Windows/app.manifest
  31. 17 0
      Orientation/Platforms/iOS/Orientation.iOS.csproj
  32. 5 5
      Orientation/Platforms/iOS/Program.cs
  33. 0 28
      Orientation/Properties/AssemblyInfo.cs
  34. 138 0
      Orientation/README.md

+ 45 - 0
Orientation/.vscode/launch.json

@@ -0,0 +1,45 @@
+{
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "name": "Launch Windows",
+            "type": "coreclr",
+            "request": "launch",
+            "preLaunchTask": "build-windows",
+            "program": "${workspaceFolder}/Platforms/Windows/bin/Debug/net8.0-windows/Orientation.Windows.exe",
+            "args": [],
+            "cwd": "${workspaceFolder}/Platforms/Windows",
+            "stopAtEntry": false
+        },
+        {
+            "name": "Launch DesktopGL",
+            "type": "coreclr",
+            "request": "launch",
+            "preLaunchTask": "build-desktopgl",
+            "program": "${workspaceFolder}/Platforms/Desktop/bin/Debug/net8.0/Orientation.DesktopGL.exe",
+            "args": [],
+            "cwd": "${workspaceFolder}/Platforms/Desktop",
+            "stopAtEntry": false
+        },
+        {
+            "name": "Launch Android",
+            "type": "coreclr",
+            "request": "launch",
+            "preLaunchTask": "build-android",
+            "program": "${workspaceFolder}/Platforms/Android/bin/Debug/net8.0-android/Orientation.Android.dll",
+            "args": [],
+            "cwd": "${workspaceFolder}/Platforms/Android",
+            "stopAtEntry": false
+        },
+        {
+            "name": "Launch iOS",
+            "type": "coreclr",
+            "request": "launch",
+            "preLaunchTask": "build-ios",
+            "program": "${workspaceFolder}/Platforms/iOS/bin/Debug/net8.0-ios/Orientation.iOS.dll",
+            "args": [],
+            "cwd": "${workspaceFolder}/Platforms/iOS",
+            "stopAtEntry": false
+        }
+    ]
+}

+ 140 - 0
Orientation/.vscode/tasks.json

@@ -0,0 +1,140 @@
+{
+    "version": "2.0.0",
+    "tasks": [
+        {
+            "label": "build-windows",
+            "type": "shell",
+            "command": "dotnet",
+            "args": [
+                "build",
+                "Platforms/Windows/Orientation.Windows.csproj",
+                "/property:GenerateFullPaths=true",
+                "/consoleloggerparameters:NoSummary"
+            ],
+            "group": "build",
+            "presentation": {
+                "reveal": "silent"
+            },
+            "problemMatcher": "$msCompile",
+            "isBackground": false
+        },
+        {
+            "label": "build-desktopgl",
+            "type": "shell",
+            "command": "dotnet",
+            "args": [
+                "build",
+                "Platforms/Desktop/Orientation.DesktopGL.csproj",
+                "/property:GenerateFullPaths=true",
+                "/consoleloggerparameters:NoSummary"
+            ],
+            "group": "build",
+            "presentation": {
+                "reveal": "silent"
+            },
+            "problemMatcher": "$msCompile",
+            "isBackground": false
+        },
+        {
+            "label": "build-android",
+            "type": "shell",
+            "command": "dotnet",
+            "args": [
+                "build",
+                "Platforms/Android/Orientation.Android.csproj",
+                "/property:GenerateFullPaths=true",
+                "/consoleloggerparameters:NoSummary"
+            ],
+            "group": "build",
+            "presentation": {
+                "reveal": "always"
+            },
+            "problemMatcher": "$msCompile",
+            "isBackground": false
+        },
+        {
+            "label": "build-ios",
+            "type": "shell",
+            "command": "dotnet",
+            "args": [
+                "build",
+                "Platforms/iOS/Orientation.iOS.csproj",
+                "/property:GenerateFullPaths=true",
+                "/consoleloggerparameters:NoSummary"
+            ],
+            "group": "build",
+            "presentation": {
+                "reveal": "always"
+            },
+            "problemMatcher": "$msCompile",
+            "isBackground": false
+        },
+        {
+            "label": "run-windows",
+            "type": "shell",
+            "command": "dotnet",
+            "args": [
+                "run",
+                "--project",
+                "Platforms/Windows/Orientation.Windows.csproj"
+            ],
+            "group": {
+                "kind": "build",
+                "isDefault": true
+            },
+            "presentation": {
+                "reveal": "always"
+            },
+            "problemMatcher": "$msCompile",
+            "isBackground": false
+        },
+        {
+            "label": "run-desktopgl",
+            "type": "shell",
+            "command": "dotnet",
+            "args": [
+                "run",
+                "--project",
+                "Platforms/Desktop/Orientation.DesktopGL.csproj"
+            ],
+            "group": "build",
+            "presentation": {
+                "reveal": "always"
+            },
+            "problemMatcher": "$msCompile",
+            "isBackground": false
+        },
+        {
+            "label": "run-android",
+            "type": "shell",
+            "command": "dotnet",
+            "args": [
+                "run",
+                "--project",
+                "Platforms/Android/Orientation.Android.csproj"
+            ],
+            "group": "build",
+            "presentation": {
+                "reveal": "always"
+            },
+            "problemMatcher": "$msCompile",
+            "isBackground": false
+        },
+        {
+            "label": "run-ios",
+            "type": "shell",
+            "command": "dotnet",
+            "args": [
+                "run",
+                "--project",
+                "Platforms/iOS/Orientation.iOS.csproj"
+            ],
+            "group": "build",
+            "presentation": {
+                "reveal": "always"
+            },
+            "problemMatcher": "$msCompile",
+            "isBackground": false
+        }
+    ]
+}

+ 0 - 34
Orientation/Activity1.cs

@@ -1,34 +0,0 @@
-using System;
-
-using Android.App;
-using Android.Content;
-using Android.Runtime;
-using Android.Views;
-using Android.Widget;
-using Android.OS;
-using Android.Content.PM;
-using Microsoft.Xna.Framework;
-
-namespace Orientation
-{
-	[Activity (Label = "Orientation", MainLauncher = true
-	           ,Icon = "@drawable/icon"
-	           , Theme = "@style/Theme.Splash"
-	           ,ConfigurationChanges=ConfigChanges.Orientation|ConfigChanges.Keyboard|ConfigChanges.KeyboardHidden
-	           ,ScreenOrientation=ScreenOrientation.Landscape
-	           )]
-	public class Activity1 : AndroidGameActivity
-	{
-		protected override void OnCreate (Bundle bundle)
-		{
-			base.OnCreate (bundle);
-						
-			OrientationSample.OrientationSample.Activity = this;		
-			OrientationSample.OrientationSample g = new OrientationSample.OrientationSample();						
-			SetContentView (g.Window);
-			g.Run();						
-		}
-	}
-}
-
-

BIN
Orientation/Assets/Content/Font.xnb


+ 0 - 0
Orientation/Background.png → Orientation/Core/Content/Background.png


+ 32 - 0
Orientation/Core/Content/Content.mgcb

@@ -0,0 +1,32 @@
+#----------------------------- Global Properties ----------------------------#
+
+/outputDir:bin/$(Platform)
+/intermediateDir:obj/$(Platform)
+/platform:Windows
+/config:
+/profile:HiDef
+/compress:False
+
+#-------------------------------- References --------------------------------#
+
+
+#---------------------------------- Content ----------------------------------#
+
+#begin directions.png
+/importer:TextureImporter
+/processor:TextureProcessor
+/processorParam:ColorKeyColor=255,0,255,255
+/processorParam:ColorKeyEnabled=True
+/processorParam:GenerateMipmaps=False
+/processorParam:PremultiplyAlpha=True
+/processorParam:ResizeToPowerOfTwo=False
+/processorParam:MakeSquare=False
+/processorParam:TextureFormat=Color
+/build:directions.png
+
+#begin Font.spritefont
+/importer:FontDescriptionImporter
+/processor:FontDescriptionProcessor
+/processorParam:PremultiplyAlpha=True
+/processorParam:TextureFormat=Compressed
+/build:Font.spritefont

+ 1 - 1
Orientation/Assets/Content/Font.spritefont → Orientation/Core/Content/Font.spritefont

@@ -11,7 +11,7 @@ with.
     <!--
     Modify this string to change the font that will be imported.
     -->
-    <FontName>Segoe UI Mono</FontName>
+    <FontName>Arial</FontName>
 
     <!--
     Size is a float value, measured in points. Modify this value to change

BIN
Orientation/Core/Content/Font.xnb


+ 0 - 0
Orientation/GameThumbnail.png → Orientation/Core/Content/GameThumbnail.png


+ 0 - 0
Orientation/Resources/drawable/Icon.png → Orientation/Core/Content/Icon.ico


+ 0 - 0
Orientation/Assets/Content/directions.png → Orientation/Core/Content/directions.png


BIN
Orientation/Assets/Content/directions.xnb → Orientation/Core/Content/directions.xnb


+ 2 - 15
Orientation/LayoutSample.cs → Orientation/Core/LayoutSample.cs

@@ -1,19 +1,15 @@
-#region File Information
 //-----------------------------------------------------------------------------
 // LayoutSample.cs
 //
 // Microsoft XNA Community Game Platform
 // Copyright (C) Microsoft Corporation. All rights reserved.
 //-----------------------------------------------------------------------------
-#endregion
 
-#region Using Statements
 using System;
 using Microsoft.Xna.Framework;
 using Microsoft.Xna.Framework.Graphics;
 using Microsoft.Xna.Framework.Input;
 using Microsoft.Xna.Framework.Input.Touch;
-#endregion
 
 namespace LayoutSample
 {
@@ -22,7 +18,6 @@ namespace LayoutSample
     /// </summary>
     public class LayoutSample : Microsoft.Xna.Framework.Game
     {
-        #region Fields
         
         GraphicsDeviceManager graphics;
         SpriteBatch spriteBatch;
@@ -36,18 +31,13 @@ namespace LayoutSample
         // Do we allow dynamically locking/unlocking the orientation?
         bool enableOrientationLocking = false;
 
-        #endregion
 
-        #region Initialization
 
         public LayoutSample()
         {
             graphics = new GraphicsDeviceManager(this);
             Content.RootDirectory = "Content";
 
-            // Frame rate is 30 fps by default for Windows Phone.
-            TargetElapsedTime = TimeSpan.FromTicks(333333);
-
             // DISCLAMER:
             // Four different scenarios for initializing orientation support are presented below.
             // The first two scenarios are the most common and are recommended for use in most
@@ -82,7 +72,9 @@ namespace LayoutSample
             // enableOrientationLocking = true;
 
             // Switch to full screen mode
+#if MOBILE
             graphics.IsFullScreen = true;
+#endif
         }
 
         /// <summary>
@@ -99,9 +91,7 @@ namespace LayoutSample
             base.Initialize();
         }
 
-        #endregion
 
-        #region Load and Unload
 
         /// <summary>
         /// LoadContent will be called once per game and is the place to load
@@ -125,9 +115,7 @@ namespace LayoutSample
             // Nothing to unload in this sample
         }
 
-        #endregion
 
-        #region Update and Render
 
         /// <summary>
         /// Allows the game to run logic such as updating the world,
@@ -226,6 +214,5 @@ namespace LayoutSample
             base.Draw(gameTime);
         }
 
-        #endregion
     }
 }

+ 9 - 0
Orientation/Core/Orientation.Core.csproj

@@ -0,0 +1,9 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <TargetFramework>net8.0</TargetFramework>
+    <AssemblyName>Orientation.Core</AssemblyName>
+  </PropertyGroup>
+  <ItemGroup>
+    <PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.4.0" />
+  </ItemGroup>
+</Project>

+ 9 - 20
Orientation/OrientationSample.cs → Orientation/Core/OrientationSample.cs

@@ -1,28 +1,23 @@
-#region File Information
 //-----------------------------------------------------------------------------
 // OrientationSample.cs
 //
 // Microsoft XNA Community Game Platform
 // Copyright (C) Microsoft Corporation. All rights reserved.
 //-----------------------------------------------------------------------------
-#endregion
 
-#region Using Statements
 using System;
 using Microsoft.Xna.Framework;
 using Microsoft.Xna.Framework.Graphics;
 using Microsoft.Xna.Framework.Input;
 using Microsoft.Xna.Framework.Input.Touch;
-#endregion
 
 namespace OrientationSample
 {
     /// <summary>
     /// This is the main type for your game
     /// </summary>
-    public class OrientationSample : Microsoft.Xna.Framework.Game
+    public class OrientationSampleGame : Game
     {
-        #region Fields
         
         GraphicsDeviceManager graphics;
         SpriteBatch spriteBatch;
@@ -36,11 +31,9 @@ namespace OrientationSample
         // Do we allow dynamically locking/unlocking the orientation?
         bool enableOrientationLocking = false;
 
-        #endregion
 
-        #region Initialization
 
-        public OrientationSample()
+        public OrientationSampleGame()
         {
             graphics = new GraphicsDeviceManager(this);
             Content.RootDirectory = "Content";
@@ -76,13 +69,14 @@ namespace OrientationSample
             // Game supports all possible orientations and enablyes dynamically locking/unlocking the
             // orientation.
             // (Uncomment the following lines):
-             graphics.SupportedOrientations = DisplayOrientation.Portrait |
-                                              DisplayOrientation.LandscapeLeft |
-                                              DisplayOrientation.LandscapeRight;
+            graphics.SupportedOrientations = DisplayOrientation.Portrait |
+                                             DisplayOrientation.LandscapeLeft |
+                                             DisplayOrientation.LandscapeRight;
             //enableOrientationLocking = true;
 
-            // Switch to full screen mode
-            graphics.IsFullScreen = true;
+            graphics.IsFullScreen = false;
+            
+            IsMouseVisible = true;
         }
 
         /// <summary>
@@ -99,9 +93,7 @@ namespace OrientationSample
             base.Initialize();
         }
 
-        #endregion
 
-        #region Load and Unload
 
         /// <summary>
         /// LoadContent will be called once per game and is the place to load
@@ -125,9 +117,7 @@ namespace OrientationSample
             // Nothing to unload in this sample
         }
 
-        #endregion
 
-        #region Update and Render
 
         /// <summary>
         /// Allows the game to run logic such as updating the world,
@@ -137,7 +127,7 @@ namespace OrientationSample
         protected override void Update(GameTime gameTime)
         {
             // Allows the game to exit
-            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
+            if (Keyboard.GetState().IsKeyDown(Keys.Escape) || GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                 this.Exit();
 
             // If we enable locking/unlocking the orientation...
@@ -226,6 +216,5 @@ namespace OrientationSample
             base.Draw(gameTime);
         }
 
-        #endregion
     }
 }

+ 0 - 90
Orientation/Orientation.Android.csproj

@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>10.0.0</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{0A5F2E21-0B29-4627-8F06-28BA442B21F7}</ProjectGuid>
-    <ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <OutputType>Library</OutputType>
-    <RootNamespace>Orientation</RootNamespace>
-    <MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
-    <MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
-    <AndroidResgenClass>Resource</AndroidResgenClass>
-    <AndroidApplication>True</AndroidApplication>
-    <AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
-    <AssemblyName>Orientation</AssemblyName>
-    <TargetFrameworkVersion>v2.3</TargetFrameworkVersion>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <DefineConstants>DEBUG;</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>False</ConsolePause>
-    <AndroidLinkMode>None</AndroidLinkMode>
-    <EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>none</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
-    <ConsolePause>False</ConsolePause>
-    <AndroidLinkMode>SdkOnly</AndroidLinkMode>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Xml" />
-    <Reference Include="System.Core" />
-    <Reference Include="Mono.Android" />
-    <Reference Include="OpenTK" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Activity1.cs" />
-    <Compile Include="Resources\Resource.designer.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="LayoutSample.cs" />
-    <Compile Include="OrientationSample.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <AndroidResource Include="Resources\drawable\Icon.png" />
-    <AndroidResource Include="Resources\values\Styles.xml" />
-    <AndroidResource Include="Resources\drawable\Splash.png" />
-  </ItemGroup>
-  <Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
-  <ItemGroup>
-    <Folder Include="Assets\" />
-    <Folder Include="Resources\values\" />
-    <Folder Include="Resources\layout\" />
-    <Folder Include="Assets\Content\" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Background.png" />
-    <None Include="GameThumbnail.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <AndroidAsset Include="Assets\Content\directions.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Assets\Content\Font.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\ThirdParty\Lidgren.Network\Lidgren.Network.Android.csproj">
-      <Project>{565129E0-4EE5-4F6F-B403-C3484C9740BE}</Project>
-      <Name>Lidgren.Network.Android</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\..\MonoGame.Framework\MonoGame.Framework.Android.csproj">
-      <Project>{BA9476CF-99BA-4D03-92F2-73D2C5E58883}</Project>
-      <Name>MonoGame.Framework.Android</Name>
-    </ProjectReference>
-  </ItemGroup>
-</Project>

+ 0 - 86
Orientation/Orientation.iOS.csproj

@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
-    <ProductVersion>10.0.0</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{DCE047E9-894F-4C5C-B972-835B62CDEB48}</ProjectGuid>
-    <ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>MonoGame.Samples.Orientation</RootNamespace>
-    <AssemblyName>MonoGameSamplesOrientation</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
-    <DefineConstants>DEBUG;</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>False</ConsolePause>
-    <MtouchDebug>True</MtouchDebug>
-    <MtouchProfiling>True</MtouchProfiling>
-    <MtouchLink>None</MtouchLink>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
-    <DebugType>none</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\iPhoneSimulator\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>False</ConsolePause>
-    <MtouchLink>None</MtouchLink>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\iPhone\Debug</OutputPath>
-    <DefineConstants>DEBUG;</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>False</ConsolePause>
-    <CodesignKey>iPhone Developer</CodesignKey>
-    <MtouchDebug>True</MtouchDebug>
-    <MtouchProfiling>True</MtouchProfiling>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
-    <DebugType>none</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\iPhone\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>False</ConsolePause>
-    <CodesignKey>iPhone Developer</CodesignKey>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Xml" />
-    <Reference Include="System.Core" />
-    <Reference Include="monotouch" />
-    <Reference Include="OpenTK" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Info.iOS.plist">
-      <Link>Info.plist</Link>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Main.cs" />
-    <Compile Include="LayoutSample.cs">
-    </Compile>
-    <Compile Include="OrientationSample.cs">
-    </Compile>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <ItemGroup>
-    <Content Include="Assets\Content\directions.xnb">
-      <Link>Content\directions.xnb</Link>
-    </Content>
-    <Content Include="Assets\Content\Font.xnb">
-      <Link>Content\Font.xnb</Link>
-    </Content>
-  </ItemGroup>
-</Project>

+ 48 - 0
Orientation/Orientation.sln

@@ -0,0 +1,48 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.5.2.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Orientation.Core", "Core\MonoGame.Orientation.Core.csproj", "{E1F2G3H4-I5J6-7890-FGHI-345678901234}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Orientation.Windows", "Platforms\Windows\MonoGame.Orientation.Windows.csproj", "{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Orientation.DesktopGL", "Platforms\Desktop\MonoGame.Orientation.DesktopGL.csproj", "{B1C2D3E4-F5G6-7890-BCDE-F12345678901}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Orientation.Android", "Platforms\Android\MonoGame.Orientation.Android.csproj", "{C1D2E3F4-G5H6-7890-CDEF-123456789012}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Orientation.iOS", "Platforms\iOS\MonoGame.Orientation.iOS.csproj", "{D1E2F3G4-H5I6-7890-DEFG-234567890123}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+   {E1F2G3H4-I5J6-7890-FGHI-345678901234}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+   {E1F2G3H4-I5J6-7890-FGHI-345678901234}.Debug|Any CPU.Build.0 = Debug|Any CPU
+   {E1F2G3H4-I5J6-7890-FGHI-345678901234}.Release|Any CPU.ActiveCfg = Release|Any CPU
+   {E1F2G3H4-I5J6-7890-FGHI-345678901234}.Release|Any CPU.Build.0 = Release|Any CPU
+   {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+   {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Debug|Any CPU.Build.0 = Debug|Any CPU
+   {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Release|Any CPU.ActiveCfg = Release|Any CPU
+   {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Release|Any CPU.Build.0 = Release|Any CPU
+   {B1C2D3E4-F5G6-7890-BCDE-F12345678901}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+   {B1C2D3E4-F5G6-7890-BCDE-F12345678901}.Debug|Any CPU.Build.0 = Debug|Any CPU
+   {B1C2D3E4-F5G6-7890-BCDE-F12345678901}.Release|Any CPU.ActiveCfg = Release|Any CPU
+   {B1C2D3E4-F5G6-7890-BCDE-F12345678901}.Release|Any CPU.Build.0 = Release|Any CPU
+   {C1D2E3F4-G5H6-7890-CDEF-123456789012}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+   {C1D2E3F4-G5H6-7890-CDEF-123456789012}.Debug|Any CPU.Build.0 = Debug|Any CPU
+   {C1D2E3F4-G5H6-7890-CDEF-123456789012}.Release|Any CPU.ActiveCfg = Release|Any CPU
+   {C1D2E3F4-G5H6-7890-CDEF-123456789012}.Release|Any CPU.Build.0 = Release|Any CPU
+   {D1E2F3G4-H5I6-7890-DEFG-234567890123}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+   {D1E2F3G4-H5I6-7890-DEFG-234567890123}.Debug|Any CPU.Build.0 = Debug|Any CPU
+   {D1E2F3G4-H5I6-7890-DEFG-234567890123}.Release|Any CPU.ActiveCfg = Release|Any CPU
+   {D1E2F3G4-H5I6-7890-DEFG-234567890123}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {515E7CE3-C403-4D23-AE01-D879D98DFBA1}
+	EndGlobalSection
+EndGlobal

+ 31 - 0
Orientation/Platforms/Android/AndroidManifest.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    android:versionCode="1"
+    android:versionName="1.0"
+    package="com.orientation.sample">
+
+    <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" />
+
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+
+    <application android:allowBackup="true"
+                 android:icon="@drawable/icon"
+                 android:label="Orientation Sample"
+                 android:theme="@style/Theme.Splash">
+        
+        <activity android:name="crc64e1fb321c08285b90.Activity1"
+                  android:exported="true"
+                  android:label="Orientation"
+                  android:configChanges="orientation|keyboardHidden|keyboard"
+                  android:screenOrientation="landscape"
+                  android:launchMode="singleInstance">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+    </application>
+
+</manifest>

+ 32 - 0
Orientation/Platforms/Android/MainActivity.cs

@@ -0,0 +1,32 @@
+using System;
+
+using Android.App;
+using Android.Content;
+using Android.Runtime;
+using Android.Views;
+using Android.Widget;
+using Android.OS;
+using Android.Content.PM;
+using Microsoft.Xna.Framework;
+
+namespace OrientationSample.Android
+{
+	[Activity (Label = "Orientation", MainLauncher = true,
+	           Icon = "@drawable/icon",
+	           Theme = "@style/Theme.Splash",
+	           ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden,
+	           ScreenOrientation = ScreenOrientation.Landscape)]
+	public class Activity1 : AndroidGameActivity
+	{
+	protected override void OnCreate (Bundle bundle)
+	{
+		base.OnCreate (bundle);
+					
+		var g = new OrientationSampleGame();						
+		SetContentView(g.Window);
+		g.Run();						
+	}
+	}
+}
+
+

+ 17 - 0
Orientation/Platforms/Android/Orientation.Android.csproj

@@ -0,0 +1,17 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <TargetFramework>net8.0-android</TargetFramework>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>MonoGame.Orientation.Android</RootNamespace>
+  </PropertyGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Core\Orientation.Core.csproj" />
+    <PackageReference Include="MonoGame.Framework.Android" Version="3.8.4.0" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Content Include="..\..\Core\Content\**\*.xnb" Link="Content\%(RecursiveDir)%(Filename)%(Extension)">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
+</Project>

+ 0 - 0
Orientation/Resources/Resource.designer.cs → Orientation/Platforms/Android/Resources/Resource.designer.cs


BIN
Orientation/Platforms/Android/Resources/drawable/Icon.png


+ 0 - 0
Orientation/Resources/drawable/Splash.png → Orientation/Platforms/Android/Resources/drawable/Splash.png


+ 7 - 7
Orientation/Resources/values/Styles.xml → Orientation/Platforms/Android/Resources/values/Styles.xml

@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-  <style name="Theme.Splash" parent="android:Theme">
-    <item name="android:windowBackground">@drawable/splash</item>
-    <item name="android:windowNoTitle">true</item>
-  </style>
-</resources>
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+  <style name="Theme.Splash" parent="android:Theme">
+    <item name="android:windowBackground">@drawable/splash</item>
+    <item name="android:windowNoTitle">true</item>
+  </style>
+</resources>

+ 17 - 0
Orientation/Platforms/Desktop/Orientation.DesktopGL.csproj

@@ -0,0 +1,17 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <TargetFramework>net8.0</TargetFramework>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>MonoGame.Orientation.Desktop</RootNamespace>
+  </PropertyGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Core\Orientation.Core.csproj" />
+    <PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.4.0" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Content Include="..\..\Core\Content\**\*.xnb" Link="Content\%(RecursiveDir)%(Filename)%(Extension)">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
+</Project>

+ 13 - 0
Orientation/Platforms/Desktop/Program.cs

@@ -0,0 +1,13 @@
+using System;
+
+namespace OrientationSample.Desktop
+{
+    public static class Program
+    {
+        static void Main()
+        {
+            using (var game = new OrientationSampleGame())
+                game.Run();
+        }
+    }
+}

+ 19 - 0
Orientation/Platforms/Windows/Orientation.Windows.csproj

@@ -0,0 +1,19 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <TargetFramework>net8.0-windows</TargetFramework>
+    <UseWPF>false</UseWPF>
+    <UseWindowsForms>false</UseWindowsForms>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>MonoGame.Orientation.Windows</RootNamespace>
+  </PropertyGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Core\Orientation.Core.csproj" />
+    <PackageReference Include="MonoGame.Framework.WindowsDX" Version="3.8.*" />
+  </ItemGroup>
+  
+  <ItemGroup>
+    <Content Include="..\..\Core\Content\**\*.xnb" Link="Content\%(RecursiveDir)%(Filename)%(Extension)">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
+</Project>

+ 14 - 0
Orientation/Platforms/Windows/Program.cs

@@ -0,0 +1,14 @@
+using System;
+
+namespace OrientationSample.Windows
+{
+    public static class Program
+    {
+        [STAThread]
+        static void Main()
+        {
+            using (var game = new OrientationSampleGame())
+                game.Run();
+        }
+    }
+}

+ 33 - 0
Orientation/Platforms/Windows/app.manifest

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
+  <assemblyIdentity version="1.0.0.0" name="OrientationSample"/>
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+    <security>
+      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+        <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+      </requestedPrivileges>
+    </security>
+  </trustInfo>
+
+  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+    <application>
+      <!-- Windows 10 -->
+      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
+      <!-- Windows 8.1 -->
+      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
+      <!-- Windows Vista -->
+      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
+      <!-- Windows 7 -->
+      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
+      <!-- Windows 8 -->
+      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
+    </application>
+  </compatibility>
+
+  <application xmlns="urn:schemas-microsoft-com:asm.v3">
+    <windowsSettings>
+      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
+      <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
+    </windowsSettings>
+  </application>
+</assembly>

+ 17 - 0
Orientation/Platforms/iOS/Orientation.iOS.csproj

@@ -0,0 +1,17 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <TargetFramework>net8.0-ios</TargetFramework>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>MonoGame.Orientation.iOS</RootNamespace>
+  </PropertyGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Core\Orientation.Core.csproj" />
+    <PackageReference Include="MonoGame.Framework.iOS" Version="3.8.4.0" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Content Include="..\..\Core\Content\**\*.xnb" Link="Content\%(RecursiveDir)%(Filename)%(Extension)">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
+</Project>

+ 5 - 5
Orientation/Main.cs → Orientation/Platforms/iOS/Program.cs

@@ -2,20 +2,20 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 
-using MonoTouch.Foundation;
-using MonoTouch.UIKit;
+using Foundation;
+using UIKit;
 
-namespace OrientationSample
+namespace OrientationSample.iOS
 {
 	[Register ("AppDelegate")]
 	class Program : UIApplicationDelegate 
 	{
-		private OrientationSample game;
+		private OrientationSampleGame game;
 
 		public override void FinishedLaunching (UIApplication app)
 		{
 			// Fun begins..
-			game = new OrientationSample();
+			game = new OrientationSampleGame();
 			game.Run();
 		}
 

+ 0 - 28
Orientation/Properties/AssemblyInfo.cs

@@ -1,28 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using Android.App;
-
-// Information about this assembly is defined by the following attributes. 
-// Change them to the values specific to your project.
-
-[assembly: AssemblyTitle("Orientation")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("d_ellis")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
-// The form "{Major}.{Minor}.*" will automatically update the build and revision,
-// and "{Major}.{Minor}.{Build}.*" will update just the revision.
-
-[assembly: AssemblyVersion("1.0.0")]
-
-// The following attributes are used to specify the signing key for the assembly, 
-// if desired. See the Mono documentation for more information about signing.
-
-//[assembly: AssemblyDelaySign(false)]
-//[assembly: AssemblyKeyFile("")]
-

+ 138 - 0
Orientation/README.md

@@ -0,0 +1,138 @@
+# MonoGame Orientation Sample
+
+This is a MonoGame 3.8.4 sample project that demonstrates orientation handling in games across multiple platforms. The sample shows how to handle different screen orientations and scaling in MonoGame applications.
+
+## Project Overview
+
+This sample demonstrates:
+- Orientation handling (Portrait/Landscape)
+- Dynamic orientation locking/unlocking
+- Cross-platform compatibility
+- Proper scaling and layout management
+
+## Supported Platforms
+
+- **Windows** (DirectX) - `net8.0-windows`
+- **DesktopGL** (OpenGL) - `net8.0`
+- **Android** - `net8.0-android`
+- **iOS** - `net8.0-ios`
+
+## Prerequisites
+
+- .NET 8.0 SDK or later
+- For Android development: Android SDK with API level 21+
+- For iOS development: Xcode and iOS 11.0+
+- Visual Studio 2022 or Visual Studio Code
+
+## Project Structure
+
+```
+/Core
+    MonoGame.Orientation.Core.csproj
+    OrientationSample.cs
+    LayoutSample.cs
+/Platforms
+    /Windows
+        Orientation.Windows.csproj
+        Program.cs
+    /Desktop
+        Orientation.DesktopGL.csproj
+        Program.cs
+    /Android
+        Orientation.Android.csproj
+        MainActivity.cs
+    /iOS
+        Orientation.iOS.csproj
+        AppDelegate.cs
+        Main.cs
+Assets/Content/    # Game content files (.xnb format)
+Resources/         # Android resources
+Properties/        # Platform-specific configuration files
+```
+
+## Building the Project
+
+### Using Visual Studio
+
+1. Open `Orientation.sln` in Visual Studio 2022
+2. Select the target platform from the dropdown
+3. Build and run the project
+
+### Using Visual Studio Code
+
+1. Open the project folder in VS Code
+2. Use the provided tasks to build and run:
+   - `Ctrl+Shift+P` → "Tasks: Run Task"
+   - Select from available tasks:
+     - "build-windows" - Build Windows DirectX version
+     - "build-desktopgl" - Build cross-platform OpenGL version
+     - "build-android" - Build Android version
+     - "build-ios" - Build iOS version
+     - "run-windows" - Build and run Windows version
+     - "run-desktopgl" - Build and run DesktopGL version
+     - "run-android" - Build and run Android version
+     - "run-ios" - Build and run iOS version
+
+### Using Command Line
+
+```bash
+# Build Windows version
+cd Platforms/Windows
+ dotnet build Orientation.Windows.csproj
+
+# Build DesktopGL version
+cd ../Desktop
+ dotnet build Orientation.DesktopGL.csproj
+
+# Build Android version
+cd ../Android
+ dotnet build Orientation.Android.csproj
+
+# Build iOS version
+cd ../iOS
+ dotnet build Orientation.iOS.csproj
+```
+
+## Running the Project
+
+### Windows/DesktopGL
+Simply run the executable or use `dotnet run --project <csproj>` with the appropriate project file.
+
+### Android
+Deploy to an Android device or emulator using Visual Studio or via command line:
+```bash
+cd Platforms/Android
+ dotnet build Orientation.Android.csproj -f net8.0-android
+```
+
+### iOS
+Deploy to an iOS device or simulator using Visual Studio for Mac or Xcode.
+
+## Content Pipeline
+
+This project uses pre-built XNB content files located in `Assets/Content/`:
+- `directions.xnb` - Direction graphics
+- `Font.xnb` - Sprite font for text rendering
+
+## Dependencies
+
+- MonoGame Framework 3.8.*
+- .NET 8.0
+
+All dependencies are managed via NuGet package references in the project files.
+
+## Troubleshooting
+
+### Build Issues
+- Ensure you have .NET 8.0 SDK installed
+- Verify platform-specific SDKs are installed (Android SDK, Xcode for iOS)
+- Check NuGet package restore completed successfully
+
+### Runtime Issues
+- Ensure content files are being copied to output directory
+- Check that the appropriate MonoGame runtime is installed
+- Verify platform-specific permissions and configurations
+
+## License
+
+This sample is based on Microsoft XNA Community Game Platform samples and is provided for educational purposes.