HelixToolkit.Nex.Interop.DirectX
1.2.0
dotnet add package HelixToolkit.Nex.Interop.DirectX --version 1.2.0
NuGet\Install-Package HelixToolkit.Nex.Interop.DirectX -Version 1.2.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HelixToolkit.Nex.Interop.DirectX" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HelixToolkit.Nex.Interop.DirectX" Version="1.2.0" />
<PackageReference Include="HelixToolkit.Nex.Interop.DirectX" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HelixToolkit.Nex.Interop.DirectX --version 1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HelixToolkit.Nex.Interop.DirectX, 1.2.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HelixToolkit.Nex.Interop.DirectX@1.2.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HelixToolkit.Nex.Interop.DirectX&version=1.2.0
#tool nuget:?package=HelixToolkit.Nex.Interop.DirectX&version=1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
# HelixToolkit.Nex.Interop.DirectX
The `HelixToolkit.Nex.Interop.DirectX` package provides interoperability between DirectX and Vulkan within the HelixToolkit-Nex 3D graphics engine. It facilitates the sharing of textures and resources between DirectX and Vulkan, enabling seamless integration and rendering across different graphics APIs.
## Overview
This package is designed to bridge the gap between DirectX and Vulkan by managing shared resources and device contexts. It plays a crucial role in scenarios where applications need to leverage both DirectX and Vulkan capabilities, such as in mixed rendering pipelines or when transitioning from DirectX to Vulkan. The package includes classes and interfaces for managing DirectX devices, creating shared textures, and importing these textures into Vulkan.
## Key Types
| Type Name | Description |
|--------------------------|-----------------------------------------------------------------------------|
| `D3D11DeviceManager` | Manages the D3D11 device and provides the DXGI adapter LUID. Only supports discrete GPUs. |
| `SharedHandleType` | Enum identifying the type of shared handle used for DirectX-Vulkan interop. |
| `SharedTextureFactory` | Static class for creating D3D11 textures in shared mode for Vulkan interop. |
| `SharedTextureResult` | Result of creating a shared D3D11 texture for Vulkan interop. |
## Usage Examples
### Creating a Shared Texture for WPF
```csharp
var d3d11Manager = new D3D11DeviceManager();
nint d3d9SharedHandle = /* obtain from D3D9 */;
var sharedTexture = SharedTextureFactory.CreateForWpf(d3d11Manager, d3d9SharedHandle);
Creating a Shared Texture for WinUI
var d3d11Manager = new D3D11DeviceManager();
uint width = 1920;
uint height = 1080;
var sharedTexture = SharedTextureFactory.CreateForWinUI(d3d11Manager, width, height);
Architecture Notes
- Design Patterns: The package utilizes the Factory pattern for creating shared textures (
SharedTextureFactory) and the Adapter pattern for managing device contexts (D3D11DeviceManager). - Dependencies: This package depends on other HelixToolkit.Nex packages, specifically those related to Vulkan graphics (
HelixToolkit.Nex.Graphics.Vulkan) and rendering contexts. - Interop Strategy: The package employs VK_KHR_external_memory_win32 for Vulkan-DirectX interop, allowing textures to be shared across APIs efficiently.
- Platform Support: The project now targets
net8.0, allowing it to restore and build on any OS. However, DirectX interop is only applicable on Windows, as the Vortice DirectX bindings resolve P/Invokes into d3d11/dxgi at runtime on Windows. Usage should be guarded withOperatingSystem.IsWindows().
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- HelixToolkit.Nex.Graphics (>= 1.2.0)
- HelixToolkit.Nex.Graphics.Vulkan (>= 1.2.0)
- HelixToolkit.Nex.Interop (>= 1.2.0)
- HelixToolkit.Nex.Rendering (>= 1.2.0)
- Vortice.Direct3D11 (>= 3.6.2)
- Vortice.DXGI (>= 3.6.2)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on HelixToolkit.Nex.Interop.DirectX:
| Package | Downloads |
|---|---|
|
HelixToolkit.Nex.Avalonia
Package Description |
|
|
HelixToolkit.Nex.WinUI
Package Description |
|
|
HelixToolkit.Nex.Wpf
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.0 | 133 | 7/17/2026 |