You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<Description>AOT-compatible Interop Code for .NET Core 8+: DXGI, WIC, DirectX, Direct2D, Direct Write, Direct Composition, Media Foundation, WASAPI, WinAppSK, etc.</Description>
Copy file name to clipboardexpand all lines: README.md
+6-3
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# DirectN AOT
2
2
This is an AOT-friendly version of [DirectN](https://github.com/smourier/DirectN). Aimed at x64 targets (doesn't mean it won't work for x86 targets, but it may not work for ambiguous types) . Only for .NET Core 8 and beyond, it won't work for version below 8 or with .NET Framework.
3
3
4
-
This is a work in progress although it's been stabilizing lately. If you want to discuss how, where, why, just create an issue.
4
+
This is a still work in progress although it's been stabilizing lately. If you want to discuss how, where, why, just create an issue.
5
5
6
6
***DirectN** is the AOT-friendly version of DirectN.
7
7
***DirectN.Extensions** is a set of utilities that are not mandatory, but quite useful for programming with DirectN (and interop in general).
@@ -13,8 +13,6 @@ You don't have to use the extensions, but it's easier to use it.
13
13
14
14
The reason Extensions is separated from DirectN is more an engineering reason. The new COM Roslyn/.NET source generator at work here is very slow on ~8000 source-generated classes (since COM interop is not builtin in CLR anymore), so the DirectN project is just very difficult to work directly with in Visual Studio.
15
15
16
-
**Nuget packages** will be provided when the project is a bit more stable.
17
-
18
16
The key points that drive how code is generated and built:
19
17
* Although Win32InteropBuilder is totally generic, the goal for **DirectN** is still to create built-in interop code for modern media & graphics Windows (cross-platform is *not* a target) technologies only:
20
18
* DirectX (9 => 12)
@@ -36,6 +34,11 @@ The key points that drive how code is generated and built:
36
34
* Due to the usage of unique instances everywhere in DirectN AOT, we had to add a hack to overcome a nasty .NET 8 bug https://github.com/dotnet/runtime/issues/96901 or everything crashes very quickly at GC or finalizing time. We want to remove this hack ASAP, but it's not sure if this bug will be only released with .NET 9 or before...
37
35
* Doing interop is inherently unsafe but we want to keep a .NET-like programming whenever possible. The generated code serves a similar purpose to the CsWin32 project, but the final generated code and net result (ie: how we use it as a caller) are quite different.
38
36
37
+
# Installation
38
+
You can just compile the source (not it take minutes due to the fact ComWrapper Source geneation is *slooooowwwwww*...) or use the nuget packages
39
+
40
+
https://www.nuget.org/packages/DirectNAot/ and https://www.nuget.org/packages/DirectNAot.Extensions/
41
+
39
42
# Direct3D11 minimal sample.
40
43
The **DirectN.Samples.MinimalD3D11** sample here [https://github.com/smourier/DirectN/tree/master/DirectN/DirectN.WinUI3.MinimalD3D11](https://github.com/smourier/DirectNAot/tree/main/Samples/DirectN.Samples.MinimalD3D11) has been ported to C# from here: https://gist.github.com/d7samurai/abab8a580d0298cb2f34a44eec41d39d which features a minimal Direct3D11 *"'API familiarizer' - an uncluttered Direct3D 11 setup & basic rendering reference implementation, in the form of a complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion"* sample.
0 commit comments