Swift language bindings for Win2D
These projections contains the Win2D APIs.
- Win2D:
1.1.1
- Windows SDK:
10.0.18362.0
- Windows App SDK:
1.5-preview1
The bindings are generated from WinMD files, found in NuGet packages on Nuget.org. There are three key files which drive this:
- packages.config - this specifies the packages and their versions
- projections.json - this specifies the project/package and which apis to include in the projection
- generate-bindings.ps1 - this file reads both
packages.config
andprojections.json
and generates the appropriate bindings.
Please file any issues you have with this repository on https://github.com/thebrowsercompany/swift-winrt
In order to use Win2D, you will need to add manifest entries to your application's Win32 manifest (app.exe.manifest) like this:
<file name="Microsoft.Graphics.Canvas.dll">
<activatableClass
name="Microsoft.Graphics.Canvas.CanvasBitmap"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="Microsoft.Graphics.Canvas.CanvasDevice"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="Microsoft.Graphics.Canvas.CanvasRenderTarget"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
<activatableClass
name="Microsoft.Graphics.Canvas.Geometry.CanvasGeometry"
threadingModel="both"
xmlns="urn:schemas-microsoft-com:winrt.v1" />
</file>
When building with SPM, this manifest file needs to be copied next to the .exe after the build has completed.