فهرست منبع

Colored 3D Cube updated to SDK and MG 3.8.*

CartBlanche 3 هفته پیش
والد
کامیت
25b5ff2d00

+ 27 - 0
Colored3DCube/.vscode/launch.json

@@ -0,0 +1,27 @@
+{
+  "version": "0.2.0",
+  "configurations": [
+    {
+      "name": "Run DesktopGL",
+      "type": "coreclr",
+      "request": "launch",
+      "preLaunchTask": "build-desktopgl",
+      "program": "${workspaceFolder}/Platforms/DesktopGL/bin/Debug/net8.0/Colored3DCube.DesktopGL.dll",
+      "args": [],
+      "cwd": "${workspaceFolder}/Platforms/DesktopGL",
+      "console": "internalConsole",
+      "stopAtEntry": false
+    },
+    {
+      "name": "Run Windows",
+      "type": "coreclr",
+      "request": "launch",
+      "preLaunchTask": "build-windows",
+      "program": "${workspaceFolder}/Platforms/Windows/bin/Debug/net8.0-windows/Colored3DCube.Windows.dll",
+      "args": [],
+      "cwd": "${workspaceFolder}/Platforms/Windows",
+      "console": "internalConsole",
+      "stopAtEntry": false
+    }
+  ]
+}

+ 33 - 0
Colored3DCube/.vscode/tasks.json

@@ -0,0 +1,33 @@
+{
+  "version": "2.0.0",
+  "tasks": [
+    {
+      "label": "build-desktopgl",
+      "type": "shell",
+      "command": "dotnet build Platforms/DesktopGL/Colored3DCube.DesktopGL.csproj",
+      "group": "build",
+      "problemMatcher": "$msCompile"
+    },
+    {
+      "label": "run-desktopgl",
+      "type": "shell",
+      "command": "dotnet run --project Platforms/DesktopGL/Colored3DCube.DesktopGL.csproj",
+      "group": "test",
+      "dependsOn": "build-desktopgl"
+    },
+    {
+      "label": "build-windows",
+      "type": "shell",
+      "command": "dotnet build Platforms/Windows/Colored3DCube.Windows.csproj",
+      "group": "build",
+      "problemMatcher": "$msCompile"
+    },
+    {
+      "label": "run-windows",
+      "type": "shell",
+      "command": "dotnet run --project Platforms/Windows/Colored3DCube.Windows.csproj",
+      "group": "test",
+      "dependsOn": "build-windows"
+    }
+  ]
+}

+ 0 - 75
Colored3DCube/Colored3DCube.MacOS.csproj

@@ -1,75 +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)' == '' ">x86</Platform>
-    <ProductVersion>10.0.0</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{CF7A194A-CF38-4379-909F-1B5FFB8F79C4}</ProjectGuid>
-    <ProjectTypeGuids>{948B3504-5B70-4649-8FE4-BDE1FB46EC69};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>Colored3DCube</RootNamespace>
-    <AssemblyName>Colored3DCube</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <DefineConstants>DEBUG; MONOMAC</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <PlatformTarget>x86</PlatformTarget>
-    <ConsolePause>False</ConsolePause>
-    <EnableCodeSigning>False</EnableCodeSigning>
-    <CreatePackage>False</CreatePackage>
-    <EnablePackageSigning>False</EnablePackageSigning>
-    <IncludeMonoRuntime>False</IncludeMonoRuntime>
-    <UseSGen>False</UseSGen>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
-    <DebugType>none</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <PlatformTarget>x86</PlatformTarget>
-    <ConsolePause>False</ConsolePause>
-    <EnableCodeSigning>False</EnableCodeSigning>
-    <CreatePackage>False</CreatePackage>
-    <EnablePackageSigning>False</EnablePackageSigning>
-    <IncludeMonoRuntime>False</IncludeMonoRuntime>
-    <UseSGen>False</UseSGen>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Xml" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="MonoMac" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Info.plist">
-    </None>
-    <None Include="Game.ico" />
-    <None Include="GameThumbnail.png" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" />
-  <ItemGroup>
-    <Compile Include="Game1.cs" />
-    <Compile Include="Program.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\ThirdParty\Lidgren.Network\Lidgren.Network.MacOS.csproj">
-      <Project>{AE483C29-042E-4226-BA52-D247CE7676DA}</Project>
-      <Name>Lidgren.Network.MacOS</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\..\MonoGame.Framework\MonoGame.Framework.MacOS.csproj">
-      <Project>{36C538E6-C32A-4A8D-A39C-566173D7118E}</Project>
-      <Name>MonoGame.Framework.MacOS</Name>
-    </ProjectReference>
-  </ItemGroup>
-</Project>

+ 45 - 0
Colored3DCube/Colored3DCube.sln

@@ -0,0 +1,45 @@
+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}") = "Colored3DCube.Core", "Core\Colored3DCube.Core.csproj", "{CF7A194A-CF38-4379-909F-1B5FFB8F79C1}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Colored3DCube.DesktopGL", "Platforms\DesktopGL\Colored3DCube.DesktopGL.csproj", "{CF7A194A-CF38-4379-909F-1B5FFB8F79C2}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Colored3DCube.Windows", "Platforms\Windows\Colored3DCube.Windows.csproj", "{CF7A194A-CF38-4379-909F-1B5FFB8F79C3}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Colored3DCube.Android", "Platforms\Android\Colored3DCube.Android.csproj", "{CF7A194A-CF38-4379-909F-1B5FFB8F79C4}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Colored3DCube.iOS", "Platforms\iOS\Colored3DCube.iOS.csproj", "{CF7A194A-CF38-4379-909F-1B5FFB8F79C5}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C1}.Release|Any CPU.Build.0 = Release|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C2}.Release|Any CPU.Build.0 = Release|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C3}.Release|Any CPU.Build.0 = Release|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C4}.Release|Any CPU.Build.0 = Release|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{CF7A194A-CF38-4379-909F-1B5FFB8F79C5}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 11 - 0
Colored3DCube/Core/Colored3DCube.Core.csproj

@@ -0,0 +1,11 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <TargetFramework>net8.0</TargetFramework>
+    <AssemblyName>Colored3DCube.Core</AssemblyName>
+    <RootNamespace>Colored3DCube</RootNamespace>
+    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+  </PropertyGroup>
+  <ItemGroup>
+    <PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.*" />
+  </ItemGroup>
+</Project>

+ 0 - 0
Colored3DCube/Game.ico → Colored3DCube/Core/Game.ico


+ 213 - 0
Colored3DCube/Core/Game1.cs

@@ -0,0 +1,213 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Content;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+
+namespace Colored3DCube
+{
+	public class Game1 : Game
+	{
+
+		GraphicsDeviceManager graphics;
+		KeyboardState currentKeys;
+		BasicEffect basicEffect;
+
+		Matrix worldMatrix, viewMatrix, projectionMatrix;
+
+		public Game1()
+		{
+			graphics = new GraphicsDeviceManager(this);
+			Content.RootDirectory = "Content";
+
+			graphics.PreferredBackBufferWidth = 480;
+			graphics.PreferredBackBufferHeight = 640;
+
+#if ___MOBILE___
+			graphics.IsFullScreen = true;
+#endif
+		}
+
+		protected override void Initialize()
+		{
+			base.Initialize();
+		}
+
+		protected override void LoadContent()
+		{
+
+			// setup our graphics scene matrices
+			worldMatrix = Matrix.Identity;
+			viewMatrix = Matrix.CreateLookAt(new Vector3(0, 0, 5), Vector3.Zero, Vector3.Up);
+			projectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, GraphicsDevice.Viewport.AspectRatio, 1, 10);
+
+			// Setup our basic effect
+			basicEffect = new BasicEffect(GraphicsDevice);
+			basicEffect.World = worldMatrix;
+			basicEffect.View = viewMatrix;
+			basicEffect.Projection = projectionMatrix;
+			basicEffect.VertexColorEnabled = true;
+
+			CreateCubeVertexBuffer();
+			CreateCubeIndexBuffer();
+		}
+
+		protected override void UnloadContent()
+		{
+		}
+
+		protected override void Update(GameTime gameTime)
+		{
+			currentKeys = Keyboard.GetState();
+
+			//Press Esc To Exit
+			if (currentKeys.IsKeyDown(Keys.Escape))
+				this.Exit();
+
+			// --- Scaling logic ---
+			// Calculate scale based on the smaller of width/height, so cube fits in window
+			float minDim = Math.Min(GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);
+			float scale = minDim / 640f; // 640 is the original height, adjust as needed
+
+			// --- Rotation logic ---
+			float rotX = 0f, rotY = 0f;
+			if (currentKeys.IsKeyDown(Keys.Up))
+				rotX -= 0.05f;
+			if (currentKeys.IsKeyDown(Keys.Down))
+				rotX += 0.05f;
+			if (currentKeys.IsKeyDown(Keys.Left))
+				rotY -= 0.05f;
+			if (currentKeys.IsKeyDown(Keys.Right))
+				rotY += 0.05f;
+
+			// Apply rotation to a persistent matrix
+			// Store rotation state between frames
+			if (rotX != 0f || rotY != 0f)
+			{
+				rotationMatrix *= Matrix.CreateRotationX(rotX) * Matrix.CreateRotationY(rotY);
+			}
+
+			// Combine scaling and rotation for worldMatrix
+			worldMatrix = Matrix.CreateScale(scale) * rotationMatrix;
+
+			base.Update(gameTime);
+		}
+
+		protected override void Draw(GameTime gameTime)
+		{
+			GraphicsDevice.Clear(Color.CornflowerBlue);
+
+			GraphicsDevice.SetVertexBuffer(vertices);
+			GraphicsDevice.Indices = indices;
+
+			//RasterizerState rasterizerState1 = new RasterizerState ();
+			//rasterizerState1.CullMode = CullMode.None;
+			//graphics.GraphicsDevice.RasterizerState = rasterizerState1;
+
+			basicEffect.World = worldMatrix;
+
+			foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
+			{
+				pass.Apply();
+
+				GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, number_of_indices / 3);
+
+			}
+			base.Draw(gameTime);
+		}
+
+		const int number_of_vertices = 8;
+		const int number_of_indices = 36;
+		VertexBuffer vertices;
+
+		// Store rotation state between frames
+		Matrix rotationMatrix = Matrix.Identity;
+
+		void CreateCubeVertexBuffer()
+		{
+			VertexPositionColor[] cubeVertices = new VertexPositionColor[number_of_vertices];
+
+			cubeVertices[0].Position = new Vector3(-1, -1, -1);
+			cubeVertices[1].Position = new Vector3(-1, -1, 1);
+			cubeVertices[2].Position = new Vector3(1, -1, 1);
+			cubeVertices[3].Position = new Vector3(1, -1, -1);
+			cubeVertices[4].Position = new Vector3(-1, 1, -1);
+			cubeVertices[5].Position = new Vector3(-1, 1, 1);
+			cubeVertices[6].Position = new Vector3(1, 1, 1);
+			cubeVertices[7].Position = new Vector3(1, 1, -1);
+
+			cubeVertices[0].Color = Color.Black;
+			cubeVertices[1].Color = Color.Red;
+			cubeVertices[2].Color = Color.Yellow;
+			cubeVertices[3].Color = Color.Green;
+			cubeVertices[4].Color = Color.Blue;
+			cubeVertices[5].Color = Color.Magenta;
+			cubeVertices[6].Color = Color.White;
+			cubeVertices[7].Color = Color.Cyan;
+
+			vertices = new VertexBuffer(GraphicsDevice, VertexPositionColor.VertexDeclaration, number_of_vertices, BufferUsage.WriteOnly);
+			vertices.SetData<VertexPositionColor>(cubeVertices);
+		}
+
+		IndexBuffer indices;
+
+		void CreateCubeIndexBuffer()
+		{
+			UInt16[] cubeIndices = new UInt16[number_of_indices];
+
+			//bottom face
+			cubeIndices[0] = 0;
+			cubeIndices[1] = 2;
+			cubeIndices[2] = 3;
+			cubeIndices[3] = 0;
+			cubeIndices[4] = 1;
+			cubeIndices[5] = 2;
+
+			//top face
+			cubeIndices[6] = 4;
+			cubeIndices[7] = 6;
+			cubeIndices[8] = 5;
+			cubeIndices[9] = 4;
+			cubeIndices[10] = 7;
+			cubeIndices[11] = 6;
+
+			//front face
+			cubeIndices[12] = 5;
+			cubeIndices[13] = 2;
+			cubeIndices[14] = 1;
+			cubeIndices[15] = 5;
+			cubeIndices[16] = 6;
+			cubeIndices[17] = 2;
+
+			//back face
+			cubeIndices[18] = 0;
+			cubeIndices[19] = 7;
+			cubeIndices[20] = 4;
+			cubeIndices[21] = 0;
+			cubeIndices[22] = 3;
+			cubeIndices[23] = 7;
+
+			//left face
+			cubeIndices[24] = 0;
+			cubeIndices[25] = 4;
+			cubeIndices[26] = 1;
+			cubeIndices[27] = 1;
+			cubeIndices[28] = 4;
+			cubeIndices[29] = 5;
+
+			//right face
+			cubeIndices[30] = 2;
+			cubeIndices[31] = 6;
+			cubeIndices[32] = 3;
+			cubeIndices[33] = 3;
+			cubeIndices[34] = 6;
+			cubeIndices[35] = 7;
+
+			indices = new IndexBuffer(GraphicsDevice, IndexElementSize.SixteenBits, number_of_indices, BufferUsage.WriteOnly);
+			indices.SetData<UInt16>(cubeIndices);
+
+		}
+	}
+}

+ 0 - 0
Colored3DCube/GameThumbnail.png → Colored3DCube/Core/GameThumbnail.png


+ 0 - 190
Colored3DCube/Game1.cs

@@ -1,190 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Content;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Input;
-
-namespace Colored3DCube
-{
-	public class Game1 : Game
-	{
-
-		GraphicsDeviceManager graphics;
-		KeyboardState currentKeys;
-		BasicEffect basicEffect;
-
-		Matrix worldMatrix, viewMatrix, projectionMatrix;
-
-		public Game1 ()
-		{
-			graphics = new GraphicsDeviceManager (this);
-			Content.RootDirectory = "Content";
-		}
-
-		protected override void Initialize ()
-		{
-			base.Initialize ();
-		}
-
-		protected override void LoadContent ()
-		{
-
-			// setup our graphics scene matrices
-			worldMatrix = Matrix.Identity;
-			viewMatrix = Matrix.CreateLookAt (new Vector3 (0, 0, 5), Vector3.Zero, Vector3.Up);
-			projectionMatrix = Matrix.CreatePerspectiveFieldOfView (MathHelper.PiOver4, GraphicsDevice.Viewport.AspectRatio, 1, 10);
-
-			// Setup our basic effect
-			basicEffect = new BasicEffect (GraphicsDevice);
-			basicEffect.World = worldMatrix;
-			basicEffect.View = viewMatrix;
-			basicEffect.Projection = projectionMatrix;
-			basicEffect.VertexColorEnabled = true;
-
-			CreateCubeVertexBuffer ();
-			CreateCubeIndexBuffer ();
-		}
-
-		protected override void UnloadContent ()
-		{
-		}
-
-		protected override void Update (GameTime gameTime)
-		{
-			currentKeys = Keyboard.GetState ();
-
-			//Press Esc To Exit
-			if (currentKeys.IsKeyDown (Keys.Escape))
-				this.Exit ();
-
-
-			//Press Directional Keys to rotate cube
-			if (currentKeys.IsKeyDown (Keys.Up))
-				worldMatrix *= Matrix.CreateRotationX (-0.05f);
-			if (currentKeys.IsKeyDown (Keys.Down))
-				worldMatrix *= Matrix.CreateRotationX (0.05f);
-			if (currentKeys.IsKeyDown (Keys.Left))
-				worldMatrix *= Matrix.CreateRotationY (-0.05f);
-			if (currentKeys.IsKeyDown (Keys.Right))
-				worldMatrix *= Matrix.CreateRotationY (0.05f);
-
-			base.Update (gameTime);
-		}
-
-		protected override void Draw (GameTime gameTime)
-		{
-			GraphicsDevice.Clear (Color.CornflowerBlue);
-
-			GraphicsDevice.SetVertexBuffer (vertices);
-			GraphicsDevice.Indices = indices;
-
-			//RasterizerState rasterizerState1 = new RasterizerState ();
-			//rasterizerState1.CullMode = CullMode.None;
-			//graphics.GraphicsDevice.RasterizerState = rasterizerState1;
-
-			basicEffect.World = worldMatrix;
-
-			foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) {
-				pass.Apply ();
-
-				GraphicsDevice.DrawIndexedPrimitives (PrimitiveType.TriangleList, 0, 0,
-					number_of_vertices, 0, number_of_indices / 3);
-
-			}
-			base.Draw (gameTime);
-		}
-
-		const int number_of_vertices = 8;
-		const int number_of_indices = 36;
-		VertexBuffer vertices;
-
-		void CreateCubeVertexBuffer ()
-		{
-			VertexPositionColor[] cubeVertices = new VertexPositionColor[number_of_vertices];
-
-			cubeVertices [0].Position = new Vector3 (-1, -1, -1);
-			cubeVertices [1].Position = new Vector3 (-1, -1, 1);
-			cubeVertices [2].Position = new Vector3 (1, -1, 1);
-			cubeVertices [3].Position = new Vector3 (1, -1, -1);
-			cubeVertices [4].Position = new Vector3 (-1, 1, -1);
-			cubeVertices [5].Position = new Vector3 (-1, 1, 1);
-			cubeVertices [6].Position = new Vector3 (1, 1, 1);
-			cubeVertices [7].Position = new Vector3 (1, 1, -1);
-
-			cubeVertices [0].Color = Color.Black;
-			cubeVertices [1].Color = Color.Red;
-			cubeVertices [2].Color = Color.Yellow;
-			cubeVertices [3].Color = Color.Green;
-			cubeVertices [4].Color = Color.Blue;
-			cubeVertices [5].Color = Color.Magenta;
-			cubeVertices [6].Color = Color.White;
-			cubeVertices [7].Color = Color.Cyan;
-
-			vertices = new VertexBuffer (GraphicsDevice, VertexPositionColor.VertexDeclaration, number_of_vertices, BufferUsage.WriteOnly);
-			vertices.SetData<VertexPositionColor> (cubeVertices);
-		}
-
-		IndexBuffer indices;
-
-		void CreateCubeIndexBuffer ()
-		{
-			UInt16[] cubeIndices = new UInt16[number_of_indices];
-
-			//bottom face
-			cubeIndices [0] = 0;
-			cubeIndices [1] = 2;
-			cubeIndices [2] = 3;
-			cubeIndices [3] = 0;
-			cubeIndices [4] = 1;
-			cubeIndices [5] = 2;
-
-			//top face
-			cubeIndices [6] = 4;
-			cubeIndices [7] = 6;
-			cubeIndices [8] = 5;
-			cubeIndices [9] = 4;
-			cubeIndices [10] = 7;
-			cubeIndices [11] = 6;
-
-			//front face
-			cubeIndices [12] = 5;
-			cubeIndices [13] = 2;
-			cubeIndices [14] = 1;
-			cubeIndices [15] = 5;
-			cubeIndices [16] = 6;
-			cubeIndices [17] = 2;
-
-			//back face
-			cubeIndices [18] = 0;
-			cubeIndices [19] = 7;
-			cubeIndices [20] = 4;
-			cubeIndices [21] = 0;
-			cubeIndices [22] = 3;
-			cubeIndices [23] = 7;
-
-			//left face
-			cubeIndices [24] = 0;
-			cubeIndices [25] = 4;
-			cubeIndices [26] = 1;
-			cubeIndices [27] = 1;
-			cubeIndices [28] = 4;
-			cubeIndices [29] = 5;
-
-			//right face
-			cubeIndices [30] = 2;
-			cubeIndices [31] = 6;
-			cubeIndices [32] = 3;
-			cubeIndices [33] = 3;
-			cubeIndices [34] = 6;
-			cubeIndices [35] = 7;
-
-			indices = new IndexBuffer (GraphicsDevice, IndexElementSize.SixteenBits, number_of_indices, BufferUsage.WriteOnly);
-			indices.SetData<UInt16> (cubeIndices);
-
-		}
-
-	}
-
-}

+ 0 - 16
Colored3DCube/Info.plist

@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>CFBundleIdentifier</key>
-	<string>com.yourcompany.Colored3DCube</string>
-	<key>CFBundleName</key>
-	<string>Colored3DCube</string>
-	<key>CFBundleVersion</key>
-	<string>1</string>
-	<key>LSMinimumSystemVersion</key>
-	<string>10.6</string>
-	<key>NSPrincipalClass</key>
-	<string>NSApplication</string>
-</dict>
-</plist>

+ 16 - 0
Colored3DCube/Platforms/Android/AndroidManifest.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.colored3dcube">
+  <application android:label="Colored3DCube" android:icon="@mipmap/icon">
+    <activity android:name="android.app.NativeActivity"
+              android:label="Colored3DCube"
+              android:configChanges="orientation|keyboardHidden|screenSize"
+              android:screenOrientation="landscape"
+              android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
+      <intent-filter>
+        <action android:name="android.intent.action.MAIN" />
+        <category android:name="android.intent.category.LAUNCHER" />
+      </intent-filter>
+    </activity>
+  </application>
+  <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33" />
+</manifest>

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

@@ -0,0 +1,17 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>net8.0-android</TargetFramework>
+    <Nullable>enable</Nullable>
+    <AssemblyName>Colored3DCube.Android</AssemblyName>
+    <RootNamespace>Colored3DCube.Android</RootNamespace>
+    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+  </PropertyGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Core\Colored3DCube.Core.csproj" />
+    <PackageReference Include="MonoGame.Framework.Android" Version="3.8.*" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="AndroidManifest.xml" />
+  </ItemGroup>
+</Project>

+ 19 - 0
Colored3DCube/Platforms/Android/MainActivity.cs

@@ -0,0 +1,19 @@
+using Android.App;
+using Android.Content.PM;
+using Android.OS;
+using Microsoft.Xna.Framework;
+
+namespace Colored3DCube.Android
+{
+    [Activity(Label = "Colored3DCube", MainLauncher = true, Icon = "@mipmap/icon", Theme = "@android:style/Theme.NoTitleBar.Fullscreen", ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize, ScreenOrientation = ScreenOrientation.Landscape)]
+    public class MainActivity : AndroidGameActivity
+    {
+        protected override void OnCreate(Bundle bundle)
+        {
+            base.OnCreate(bundle);
+            var g = new Colored3DCube.Game1();
+            SetContentView((g.Services.GetService(typeof(View)) as View));
+            g.Run();
+        }
+    }
+}

+ 14 - 0
Colored3DCube/Platforms/DesktopGL/Colored3DCube.DesktopGL.csproj

@@ -0,0 +1,14 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>net8.0</TargetFramework>
+    <AssemblyName>Colored3DCube.DesktopGL</AssemblyName>
+    <RootNamespace>Colored3DCube.DesktopGL</RootNamespace>
+    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+    <ApplicationIcon>..\..\Core\Game.ico</ApplicationIcon>
+  </PropertyGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Core\Colored3DCube.Core.csproj" />
+    <PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.*" />
+  </ItemGroup>
+</Project>

+ 14 - 0
Colored3DCube/Platforms/DesktopGL/Platform.cs

@@ -0,0 +1,14 @@
+using System;
+
+namespace Colored3DCube.DesktopGL
+{
+    public static class Platform
+    {
+        [STAThread]
+        static void Main(string[] args)
+        {
+            using (var game = new Colored3DCube.Game1())
+                game.Run();
+        }
+    }
+}

+ 15 - 0
Colored3DCube/Platforms/Windows/Colored3DCube.Windows.csproj

@@ -0,0 +1,15 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <OutputType>WinExe</OutputType>
+    <TargetFramework>net8.0-windows</TargetFramework>
+    <AssemblyName>Colored3DCube.Windows</AssemblyName>
+    <RootNamespace>Colored3DCube.Windows</RootNamespace>
+    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+    <UseWindowsForms>true</UseWindowsForms>
+    <ApplicationIcon>..\..\Core\Game.ico</ApplicationIcon>
+  </PropertyGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Core\Colored3DCube.Core.csproj" />
+    <PackageReference Include="MonoGame.Framework.WindowsDX" Version="3.8.*" />
+  </ItemGroup>
+</Project>

+ 14 - 0
Colored3DCube/Platforms/Windows/Platform.cs

@@ -0,0 +1,14 @@
+using System;
+
+namespace Colored3DCube.Windows
+{
+    public static class Platform
+    {
+        [STAThread]
+        static void Main(string[] args)
+        {
+            using (var game = new Colored3DCube.Game1())
+                game.Run();
+        }
+    }
+}

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

@@ -0,0 +1,17 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>net8.0-ios</TargetFramework>
+    <Nullable>enable</Nullable>
+    <AssemblyName>Colored3DCube.iOS</AssemblyName>
+    <RootNamespace>Colored3DCube.iOS</RootNamespace>
+    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+  </PropertyGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\Core\Colored3DCube.Core.csproj" />
+    <PackageReference Include="MonoGame.Framework.iOS" Version="3.8.*" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Info.plist" />
+  </ItemGroup>
+</Project>

+ 25 - 0
Colored3DCube/Platforms/iOS/Info.plist

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>CFBundleDisplayName</key>
+    <string>Colored3DCube</string>
+    <key>CFBundleIdentifier</key>
+    <string>com.example.colored3dcube</string>
+    <key>CFBundleVersion</key>
+    <string>1.0</string>
+    <key>CFBundleShortVersionString</key>
+    <string>1.0</string>
+    <key>UILaunchStoryboardName</key>
+    <string>LaunchScreen</string>
+    <key>UISupportedInterfaceOrientations</key>
+    <array>
+        <string>UIInterfaceOrientationLandscapeLeft</string>
+        <string>UIInterfaceOrientationLandscapeRight</string>
+    </array>
+    <key>UIRequiredDeviceCapabilities</key>
+    <array>
+        <string>armv7</string>
+    </array>
+</dict>
+</plist>

+ 25 - 0
Colored3DCube/Platforms/iOS/Program.cs

@@ -0,0 +1,25 @@
+using Foundation;
+using UIKit;
+
+namespace Colored3DCube.iOS
+{
+    public class Application
+    {
+        // This is the main entry point of the application.
+        static void Main(string[] args)
+        {
+            UIApplication.Main(args, null, typeof(AppDelegate));
+        }
+    }
+
+    public class AppDelegate : UIApplicationDelegate
+    {
+        Game1 game;
+        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
+        {
+            game = new Colored3DCube.Game1();
+            game.Run();
+            return true;
+        }
+    }
+}

+ 0 - 54
Colored3DCube/Program.cs

@@ -1,54 +0,0 @@
-using System;
-
-namespace Colored3DCube
-{
-#if WINDOWS || XBOX
-    static class Program
-    {
-        /// <summary>
-        /// The main entry point for the application.
-        /// </summary>
-        static void Main(string[] args)
-        {
-            using (Game1 game = new Game1())
-            {
-                game.Run();
-            }
-        }
-    }
-#endif
-#if MONOMAC
-
-	static class Program
-	{	
-		/// <summary>
-		/// The main entry point for the application.
-		/// </summary>
-		static void Main (string[] args)
-		{
-			MonoMac.AppKit.NSApplication.Init ();
-			
-			using (var p = new MonoMac.Foundation.NSAutoreleasePool ()) {
-				MonoMac.AppKit.NSApplication.SharedApplication.Delegate = new AppDelegate();
-				MonoMac.AppKit.NSApplication.Main(args);
-			}
-		}
-	}
-	
-	class AppDelegate : MonoMac.AppKit.NSApplicationDelegate
-	{
-		Game1 game;
-		public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
-		{
-			game = new Game1();
-			game.Run();
-		}
-		
-		public override bool ApplicationShouldTerminateAfterLastWindowClosed (MonoMac.AppKit.NSApplication sender)
-		{
-			return true;
-		}
-	}
-#endif
-}
-

+ 0 - 34
Colored3DCube/Properties/AssemblyInfo.cs

@@ -1,34 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following 
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("ILSCubeColorsEnd")]
-[assembly: AssemblyProduct("ILSCubeColorsEnd")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible 
-// to COM components.  If you need to access a type in this assembly from 
-// COM, set the ComVisible attribute to true on that type. Only Windows
-// assemblies support COM.
-[assembly: ComVisible(false)]
-
-// On Windows, the following GUID is for the ID of the typelib if this
-// project is exposed to COM. On other platforms, it unique identifies the
-// title storage container when deploying this assembly to the device.
-[assembly: Guid("774b1f3a-215c-44d5-9b41-9c0dbddda3dd")]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-[assembly: AssemblyVersion("1.0.0.0")]

+ 72 - 0
Colored3DCube/README.md

@@ -0,0 +1,72 @@
+# Colored 3D Cube - MonoGame Sample
+
+This is a modernized MonoGame 3.8.* sample demonstrating a rotating colored 3D cube, now structured for cross-platform development with .NET 8.0 and VSCode/Visual Studio integration.
+
+## Project Structure
+
+- **Core/**
+  - `Colored3DCube.Core.csproj` — Shared game logic (e.g., `Game1.cs`)
+- **Platforms/DesktopGL/**
+  - `Colored3DCube.DesktopGL.csproj` — Cross-platform OpenGL version
+  - `Platform.cs` — DesktopGL entry point
+- **Platforms/Windows/**
+  - `Colored3DCube.Windows.csproj` — Windows DirectX version
+  - `Platform.cs` — Windows entry point
+- **Platforms/Android/**
+  - `Colored3DCube.Android.csproj` — Android version (scaffolded)
+  - `MainActivity.cs` — Android entry point
+  - `AndroidManifest.xml` — Android manifest
+- **Platforms/iOS/**
+  - `Colored3DCube.iOS.csproj` — iOS version (scaffolded)
+  - `Program.cs` — iOS entry point
+  - `Info.plist` — iOS app info
+- **.vscode/**
+  - `tasks.json` and `launch.json` — Build/run integration for VSCode
+
+## Requirements
+
+- .NET 8.0 SDK or later
+- MonoGame 3.8.* (restored via NuGet)
+- For Android/iOS: Xamarin/MAUI/MonoGame toolchain (see MonoGame docs)
+
+## Building and Running
+
+### Visual Studio Code (VSCode)
+- Use the built-in tasks and launch configurations:
+  - **Run DesktopGL**: Builds and runs the cross-platform version
+  - **Run Windows**: Builds and runs the Windows DirectX version
+- Press `F5` or select a configuration from the Run/Debug panel.
+
+### Command Line
+- **DesktopGL**:
+  ```sh
+  dotnet build Platforms/DesktopGL/Colored3DCube.DesktopGL.csproj
+  dotnet run --project Platforms/DesktopGL/Colored3DCube.DesktopGL.csproj
+  ```
+- **Windows**:
+  ```sh
+  dotnet build Platforms/Windows/Colored3DCube.Windows.csproj
+  dotnet run --project Platforms/Windows/Colored3DCube.Windows.csproj
+  ```
+- **Android/iOS**:
+  - Open the solution in Visual Studio (Windows or Mac) and select the Android or iOS project. (Requires Xamarin/MAUI/MonoGame for mobile targets.)
+
+## Controls
+
+- **Arrow Keys** — Rotate the cube
+- **Escape** — Exit the application
+
+## Features
+
+- Modern .NET 8.0 SDK-style projects
+- Shared game logic in `Core` project
+- Platform-specific entry points and projects
+- Procedural geometry (no content pipeline required)
+- Cross-platform: DesktopGL, Windows, Android, iOS
+- VSCode and Visual Studio integration
+
+## Notes
+
+- No Content Pipeline (.mgcb) is used; all geometry/colors are generated in code.
+- Android/iOS projects are scaffolding only; add icons/assets as needed.
+- For mobile, ensure you have the correct build tools and emulators installed.