-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
206 changed files
with
699 additions
and
34,952 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Application | ||
x:Class="Asteroids.WinUi3.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Asteroids.WinUi3"> | ||
<Application.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" /> | ||
<!-- Other merged dictionaries here --> | ||
</ResourceDictionary.MergedDictionaries> | ||
<!-- Other app resources here --> | ||
</ResourceDictionary> | ||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Microsoft.UI.Xaml; | ||
|
||
// To learn more about WinUI, the WinUI project structure, | ||
// and more about our project templates, see: http://aka.ms/winui-project-info. | ||
|
||
namespace Asteroids.WinUi3 | ||
{ | ||
/// <summary> | ||
/// Provides application-specific behavior to supplement the default Application class. | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
/// <summary> | ||
/// Initializes the singleton application object. This is the first line of authored code | ||
/// executed, and as such is the logical equivalent of main() or WinMain(). | ||
/// </summary> | ||
public App() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
/// <summary> | ||
/// Invoked when the application is launched. | ||
/// </summary> | ||
/// <param name="args">Details about the launch request and process.</param> | ||
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) | ||
{ | ||
m_window = new MainWindow(); | ||
m_window.Activate(); | ||
} | ||
|
||
private Window m_window; | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+283 Bytes
Asteroids.WinUi3/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework> | ||
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion> | ||
<RootNamespace>Asteroids.WinUi3</RootNamespace> | ||
<ApplicationManifest>app.manifest</ApplicationManifest> | ||
<Platforms>x86;x64;ARM64</Platforms> | ||
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) >= 8">win-x86;win-x64;win-arm64</RuntimeIdentifiers> | ||
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) < 8">win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers> | ||
<PublishProfile>win-$(Platform).pubxml</PublishProfile> | ||
<UseWinUI>true</UseWinUI> | ||
<EnableMsixTooling>true</EnableMsixTooling> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="Assets\SplashScreen.scale-200.png" /> | ||
<Content Include="Assets\LockScreenLogo.scale-200.png" /> | ||
<Content Include="Assets\Square150x150Logo.scale-200.png" /> | ||
<Content Include="Assets\Square44x44Logo.scale-200.png" /> | ||
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" /> | ||
<Content Include="Assets\StoreLogo.png" /> | ||
<Content Include="Assets\Wide310x150Logo.scale-200.png" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1" /> | ||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240802000" /> | ||
<PackageReference Include="SkiaSharp.Views.WinUI" Version="2.88.8" /> | ||
<Manifest Include="$(ApplicationManifest)" /> | ||
</ItemGroup> | ||
|
||
<!-- | ||
Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging | ||
Tools extension to be activated for this project even if the Windows App SDK Nuget | ||
package has not yet been restored. | ||
--> | ||
<ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'"> | ||
<ProjectCapability Include="Msix" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Asteroids.Standard\Asteroids.Standard.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Folder Include="Helpers\" /> | ||
</ItemGroup> | ||
|
||
<!-- | ||
Defining the "HasPackageAndPublishMenuAddedByProject" property here allows the Solution | ||
Explorer "Package and Publish" context menu entry to be enabled for this project even if | ||
the Windows App SDK Nuget package has not yet been restored. | ||
--> | ||
<PropertyGroup Condition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'"> | ||
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu> | ||
</PropertyGroup> | ||
|
||
<!--ADDED TO ALLOW DEUGGING WITHOUT INSTALLING THE PACKAGE TO THE OS--> | ||
<PropertyGroup> | ||
<!--SUPRESS PACKAGING--> | ||
<WindowsPackageType>None</WindowsPackageType> | ||
|
||
<!-- Bundle the WinUI3 components --> | ||
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.IO; | ||
using Windows.Storage.Streams; | ||
|
||
/// <summary> | ||
/// Helper methods for playing sound in WinUI. | ||
/// </summary> | ||
public static class SoundPlayerHelper | ||
{ | ||
/// <summary> | ||
/// Converts a standard <see cref="Stream"/> into an <see cref="IRandomAccessStream"/> that can be played by WinUI. | ||
/// </summary> | ||
/// <param name="inputStream">IO Stream to convert.</param> | ||
/// <returns>Initialized WinUI Stream.</returns> | ||
public static IRandomAccessStream ToRandomAccessStream(this Stream inputStream) | ||
{ | ||
var randomAccessStream = new InMemoryRandomAccessStream(); | ||
using (var outputStream = randomAccessStream.GetOutputStreamAt(0)) | ||
{ | ||
var writer = new DataWriter(outputStream); | ||
var buffer = new byte[inputStream.Length]; | ||
inputStream.Read(buffer, 0, buffer.Length); | ||
writer.WriteBytes(buffer); | ||
writer.StoreAsync().GetResults(); | ||
} | ||
randomAccessStream.Seek(0); | ||
return randomAccessStream; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Window | ||
x:Class="Asteroids.WinUi3.MainWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Asteroids.WinUi3" | ||
xmlns:classes="using:Asteroids.WinUi3.Classes" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
xmlns:skiasharp="using:SkiaSharp.Views.Windows" | ||
> | ||
<classes:GraphicsContainer | ||
Loaded="GraphicsContainer_Loaded" | ||
SizeChanged="GraphicsContainer_SizeChanged" | ||
KeyUp="GraphicsContainer_KeyUp" | ||
KeyDown="GraphicsContainer_KeyDown" | ||
/> | ||
</Window> |
Oops, something went wrong.