terrafx / terrafx.interop.windows

Interop bindings for Windows.
MIT License
242 stars 31 forks source link

Xbox/UAP support #347

Closed mfkl closed 1 year ago

mfkl commented 1 year ago

Description (optional)

Provide Xbox/UAP support.

Rationale

As I'm looking into libvlcsharp 4 and its support of modern UI frameworks such as WinUI and UWP, I need to implement GPU callbacks using D3D11 APIs and I like terrafx. Just checking whether the vision is set on newer tech support only, or if you'd be willing to add support to the Xbox target (e.g. UAP tfm).

Proposed API

diff --git a/sources/Interop/Windows/TerraFX.Interop.Windows.csproj b/sources/Interop/Windows/TerraFX.Interop.Windows.csproj
index 9e081ddfb2..78b0a17d8f 100644
--- a/sources/Interop/Windows/TerraFX.Interop.Windows.csproj
+++ b/sources/Interop/Windows/TerraFX.Interop.Windows.csproj
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -->
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="MSBuild.Sdk.Extras/3.0.44">

   <PropertyGroup>
     <NoWarn>$(NoWarn);CA1401;CA2252;CS1591;CS8981;SYSLIB1054</NoWarn>
     <RootNamespace>TerraFX.Interop</RootNamespace>
-    <TargetFrameworks>net6.0;net7.0</TargetFrameworks>
+    <TargetFrameworks>uap10.0;net6.0;net7.0</TargetFrameworks>
   </PropertyGroup>

   <ItemGroup>

This gave me a whooping 61397 build errors, so I'm guessing this is by design unsupported and will stay this way.

Just opening an issue to have your confirmation.

tannergooding commented 1 year ago

I understand the general desire, and I even prototyped this many years ago and had a sample repo I put up more recently about 4 years back: https://github.com/tannergooding/terrafx-xbox

That being said, I eventually landed on not supporting UWP officially in order to provide the best experience for modern .NET. This was required due to a number of core language/runtime features being .NET Core only and it provide significant perf benefits and code simplifications.

In an ideal world, either UWP would update to support modern .NET or we'd get some new Xbox indie support that would allow .NET NativeAOT to be used instead.

mfkl commented 1 year ago

Yeah that's what I thought. Thanks!