DirectXTK.NET 1.0.1

dotnet add package DirectXTK.NET --version 1.0.1                
NuGet\Install-Package DirectXTK.NET -Version 1.0.1                
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="DirectXTK.NET" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DirectXTK.NET --version 1.0.1                
#r "nuget: DirectXTK.NET, 1.0.1"                
#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.
// Install DirectXTK.NET as a Cake Addin
#addin nuget:?package=DirectXTK.NET&version=1.0.1

// Install DirectXTK.NET as a Cake Tool
#tool nuget:?package=DirectXTK.NET&version=1.0.1                

DirectXTK.NET

DirectXTK.NET is a .NET wrapper for the DirectX Tool Kit, built using C++/CLI for Silk.NET and DirectX 11.

Features

Currently only methods are wrapped that allow you to quickly load textures for your Silk.NET DirectX 11 project:

  • Texture Creation with WICTextureLoader: Load textures from files and obtain shader resource views.
  • Texture Creation with DDSTextureLoader: Load textures from *.dds files and obtain shader resource views.
  • Texture Saving: Save textures to DDS or WIC formats.

Usage

To use DirectXTK.NET, follow these steps:

  1. Install via NuGet: Add the package to your project using the .NET CLI:
    dotnet add package DirectXTK.NET
    
    Or, search for DirectXTK.NET in the NuGet Package Manager in Visual Studio.
  2. Initialize DirectX: Create and initialize a DirectX 11 device and context using Silk.NET.
  3. Use the package: Use the WICTextureHelper class to create and save textures or the DDSTextureHelper class to load .dds textures.

Example

A simple example that shows how to create and save a texture with DirectXTK.NET:

Loading with WICTextureHelper:
WICTextureHelper.CreateTextureFromFile(device, @"Resources\stone.dds", texture.GetAddressOf(), textureSrv.GetAddressOf());
Loading with DDSTextureHelper:
DDSTextureHelper.CreateDDSTextureFromFile(device, devCtx, @"Resources\sky.dds", 0, Usage.Immutable, (uint)BindFlag.ShaderResource, 0, ResourceMiscFlag.Texturecube, DDSLoaderFlag.Default, texture.GetAddressOf(), textureSrv.GetAddressOf(), DDSAlphaMode.Unknown);
Saving with WICTextureHelper:
WICTextureHelper.SaveWICTextureToFile(devCtx, texture, @"Resources\stone_out.png", ContainerFormat.Png, PixelFormat.Format32bppBGRA, true);

The sample can also be found in the repository under DirectXTKSample.

Development

Feature requests are welcome!

If you have specific feature requests or need additional methods, feel free to open an issue.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 89 12/8/2024