Direct interop Code for .NET Framework, .NET Core and .NET 5+ : DXGI, WIC, DirectX 9 to 12, Direct2D, Direct Write, Direct Composition, Media Foundation, WASAPI, CodecAPI, GDI, Spatial Audio, DVD, Windows Media Player, UWP DXInterop, WinUI3, etc.
MIT License
311
stars
28
forks
source link
ID2D1DeviceContext SetTarget does not accept null #58
The extension method throws when attempting to pass null as the target, which is necessary to resize the swapchain. I got around the issue by calling .Object.SetTarget directly but the check should probably be removed.
public static void SetTarget(this ID2D1DeviceContext context, ID2D1Image target)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
if (target == null)
{
throw new ArgumentNullException("context");
}
context.SetTarget(target);
}
The extension method throws when attempting to pass null as the target, which is necessary to resize the swapchain. I got around the issue by calling
.Object.SetTarget
directly but the check should probably be removed.