Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-platform StartKit #8275

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,36 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-mgcb": {
"version": "3.8.1.303",
"commands": [
"mgcb"
]
},
"dotnet-mgcb-editor": {
"version": "3.8.1.303",
"commands": [
"mgcb-editor"
]
},
"dotnet-mgcb-editor-linux": {
"version": "3.8.1.303",
"commands": [
"mgcb-editor-linux"
]
},
"dotnet-mgcb-editor-windows": {
"version": "3.8.1.303",
"commands": [
"mgcb-editor-windows"
]
},
"dotnet-mgcb-editor-mac": {
"version": "3.8.1.303",
"commands": [
"mgcb-editor-mac"
]
}
}
}
@@ -0,0 +1,8 @@
{
"recommendations": [
"ms-dotnettools.csdevkit",
"ms-dotnettools.dotnet-maui",
"ms-dotnettools.vscodeintellicode-csharp",
"ms-vscode.mono-debug",
]
}
@@ -0,0 +1,36 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Android Debug",
"type": "mono",
"request": "attach",
"address": "localhost",
"port": 10000,
"preLaunchTask": "Debug Android Build",
},
{
"name": "DesktopGL Debug",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Debug DesktopGL Build",
"program": "${workspaceFolder}/AutoPong.DesktopGL/bin/Debug/net8.0/AutoPong.DesktopGL.exe",
},
{
"name": "iOS Debug",
"type": "maui",
"request": "launch",
"preLaunchTask": "maui: Build",
},
{
"name": "WindowsDX Debug",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Debug WindowsDX Build",
"program": "${workspaceFolder}/AutoPong.WindowsDX/bin/Debug/net8.0-windows/AutoPong.WindowsDX.exe",
}
]
}
@@ -0,0 +1,3 @@
{
"terminal.integrated.defaultProfile.windows": "Command Prompt"
}
@@ -0,0 +1,25 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Debug Android Build",
"type": "shell",
"command": "dotnet build -p:Configuration=Debug ${workspaceFolder}/AutoPong.Android/AutoPong.Android.csproj \"/t:Install;_Run\" /p:AndroidAttachDebugger=true /p:AndroidSdbHostPort=10000",
},
{
"label": "Debug DesktopGL Build",
"type": "shell",
"command": "dotnet build -p:Configuration=Debug ${workspaceFolder}/AutoPong.DesktopGL/AutoPong.DesktopGL.csproj"
},
{
"label": "Debug iOS Build",
"type": "shell",
"command": "dotnet build -p:Configuration=Debug ${workspaceFolder}/AutoPong.iOS/AutoPong.iOS.csproj"
},
{
"label": "Debug WindowsDX Build",
"type": "shell",
"command": "dotnet build -p:Configuration=Debug ${workspaceFolder}/AutoPong.WindowsDX/AutoPong.WindowsDX.csproj"
},
]
}
@@ -0,0 +1,17 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "MonoGame Team",
"classifications": [
"MonoGame", "Games", "Mobile", "Android"
],
"name": "MonoGame StartKit (Android)",
"identity": "MonoGame.StartKit.Android",
"groupIdentity": "MonoGame.StartKit",
"shortName": "mgskandroid",
"tags": {
"language": "C#",
"type": "project"
},
"sourceName": "$safeprojectname$",
"preferNameDirectory": true
}
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="___safegamename___.Android" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="34" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<application android:label="___safegamename___"></application>
</manifest>
@@ -0,0 +1,47 @@
//-----------------------------------------------------------------------------
// MainActivity.cs
//
// MonoGame Foundation Game Platform
// Copyright (C) MonoGame Foundation. All rights reserved.
//-----------------------------------------------------------------------------

#region Using Statements
using Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Views;

using Microsoft.Xna.Framework;

using ___safegamename___.Core;
#endregion

namespace ___safegamename___.Android
{
[Activity(
Label = "___safegamename___",
MainLauncher = true,
Icon = "@drawable/icon",
Theme = "@style/Theme.Splash",
AlwaysRetainTaskState = true,
LaunchMode = LaunchMode.SingleInstance,
ScreenOrientation = ScreenOrientation.SensorLandscape,
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden
)]
public class MainActivity : AndroidGameActivity
{
private ___safegamename___Game _game;
private View _view;

protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);

_game = new ___safegamename___Game();
_view = _game.Services.GetService(typeof(View)) as View;

SetContentView(_view);
_game.Run();
}
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">___safegamename___</string>
</resources>
@@ -0,0 +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>
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-android</TargetFramework>
<SupportedOSPlatformVersion>23</SupportedOSPlatformVersion>
<OutputType>Exe</OutputType>
<ApplicationId>com.companyname.___safegamename___.Android</ApplicationId>
<ApplicationVersion>1</ApplicationVersion>
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
</PropertyGroup>
<ItemGroup>
<AndroidResource Include="Resources\Drawable\Splash.png" />
<AndroidResource Include="Resources\Values\Styles.xml" />
</ItemGroup>
<ItemGroup>
<MonoGameContentReference Include="..\___safegamename___.Core\Content\___safegamename___.mgcb" Link="Content\FuelCell.mgcb" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\___safegamename___.Core\___safegamename___.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.1.303" />
<PackageReference Include="MonoGame.Framework.Android" Version="3.8.1.303" />
</ItemGroup>
<Target Name="RestoreDotnetTools" BeforeTargets="Restore">
<Message Text="Restoring dotnet tools" Importance="High" />
<Exec Command="dotnet tool restore" />
</Target>
</Project>
@@ -0,0 +1,17 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "MonoGame Team",
"classifications": [
"MonoGame", "Games", "Desktop", "OpenGL"
],
"name": "MonoGame StartKit (Desktop)",
"identity": "MonoGame.StartKit.Desktop",
"groupIdentity": "MonoGame.StartKit",
"shortName": "mgskdesktop",
"tags": {
"language": "C#",
"type": "project"
},
"sourceName": "$safeprojectname$",
"preferNameDirectory": true
}
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,5 @@

using ___safegamename___.Core;

using var game = new ___safegamename___Game();
game.Run();
@@ -0,0 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<PublishReadyToRun>false</PublishReadyToRun>
<TieredCompilation>false</TieredCompilation>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
<ApplicationIcon>Icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<None Remove="Icon.ico" />
<None Remove="Icon.bmp" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Icon.ico" />
<EmbeddedResource Include="Icon.bmp" />
</ItemGroup>
<ItemGroup>
<MonoGameContentReference Include="..\___safegamename___.Core\Content\___safegamename___.mgcb">
<Link>Content\___safegamename___.mgcb</Link>
</MonoGameContentReference>
</ItemGroup>
<ItemGroup>
<TrimmerRootAssembly Include="Microsoft.Xna.Framework.Content.ContentTypeReader" Visible="false" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\___safegamename___.Core\___safegamename___.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.1.303" />
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.1.303" />
</ItemGroup>
<Target Name="RestoreDotnetTools" BeforeTargets="Restore">
<Message Text="Restoring dotnet tools" Importance="High" />
<Exec Command="dotnet tool restore" />
</Target>
</Project>
@@ -0,0 +1,43 @@
<?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="___safegamename___.DesktopGL"/>
<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>
<!-- A list of the Windows versions that this application has been tested on and is
is designed to work with. Uncomment the appropriate elements and Windows will
automatically selected the most compatible environment. -->

<!-- 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}" />

<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />

<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />

</application>
</compatibility>

<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">permonitorv2,permonitor</dpiAwareness>
</windowsSettings>
</application>

</assembly>
@@ -0,0 +1,17 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "MonoGame Team",
"classifications": [
"MonoGame", "Games", "Mobile", "iOS"
],
"name": "MonoGame StartKit (iOS)",
"identity": "MonoGame.StartKit.iOS",
"groupIdentity": "MonoGame.StartKit",
"shortName": "mgskios",
"tags": {
"language": "C#",
"type": "project"
},
"sourceName": "$safeprojectname$",
"preferNameDirectory": true
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,6 @@
<?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>
</dict>
</plist>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.