Nuklear.Net.Native 1.0.1

dotnet add package Nuklear.Net.Native --version 1.0.1
                    
NuGet\Install-Package Nuklear.Net.Native -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="Nuklear.Net.Native" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nuklear.Net.Native" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Nuklear.Net.Native" />
                    
Project file
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 Nuklear.Net.Native --version 1.0.1
                    
#r "nuget: Nuklear.Net.Native, 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.
#:package Nuklear.Net.Native@1.0.1
                    
#: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=Nuklear.Net.Native&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Nuklear.Net.Native&version=1.0.1
                    
Install as a Cake Tool

Nuklear.Net

.NET 10 bindings for Nuklear, a single-header immediate-mode GUI library written in C.

Status: incomplete. Not all Nuklear widgets and API surface are wrapped. The high-level C# layer covers the core widget set and rendering pipeline, but several Nuklear features remain either unbound or untested. See Missing features.


Projects

Project Description
Nuklear.Net High-level C# API (Context, InputFrame, NuklearDevice, …)
Nuklear.Net.Native P/Invoke bindings generated by CppSharp against NuklearNetNative
Nuklear.Net.NativeGen Code-gen driver (CppSharp) – run to regenerate the bindings
Examples/ Backend integrations: Silk.NET/OpenGL, OpenTK 4, MonoGame

NuGet packages

Pre-built packages for all supported platforms are uploaded as the nuget-packages artifact on every CI run. Download them from the latest Build action — expand the run, scroll to Artifacts, and download nuget-packages.

No NuGet feed is published; the packages must be consumed from a local folder source or a private feed.

Requirements

  • .NET 10 SDK
  • CMake ≥ 3.16
  • A C99 compiler (GCC / Clang / MSVC)

Building the native library

The native shared library must be built before the managed projects can compile.

Linux / macOS

./scripts/build-native.sh linux-x64   # or linux-arm64 / osx-x64 / osx-arm64

Windows

.\scripts\build-native.ps1 -Rid win-x64   # or win-arm64

The script runs CMake, builds the shared library, and copies it to Nuklear.Net.Native/runtimes/<rid>/native/.

Building the solution

dotnet build Nuklear.Net.slnx

Running examples

dotnet run --project Examples/SilkNet/Nuklear.Net.Examples.SilkNet.csproj
dotnet run --project Examples/OpenTK/Nuklear.Net.Examples.OpenTK.csproj
dotnet run --project Examples/MonoGame/Nuklear.Net.Examples.MonoGame.csproj

See Examples/README.md for backend implementation details.

Basic usage

// 1. Create the context once.
using var ctx = new Context();
ctx.Initialize(device, NuklearRenderingOptions.CreatePixelPerfect());

// 2. Each frame:
ctx.RunFrame(device,
    input =>
    {
        input.MousePosition = new Vec2(mouseX, mouseY);
        input.SetMouseButton(MouseButton.Left, leftPressed);
    },
    () =>
    {
        // Nuklear UI built here via ctx.Native (NkContext)
    });

Architecture

NuklearDevice is the rendering contract backends must implement:

  • CreateTexture – uploads RGBA pixel data (font atlas, etc.)
  • SetDrawBuffers – receives converted vertex/index buffers from nk_convert
  • RenderDrawCommand – issues one draw call per Nuklear draw command (scissor + texture)

Context owns the Nuklear context lifetime, the font atlas, input dispatch, display metrics, and HiDPI scaling.

Missing features

The following Nuklear functionality is not yet surfaced through the managed API:

  • Custom font loading (only the built-in default font is exposed)
  • nk_plot / nk_plot_function (charts)
  • nk_color_picker / nk_color_* widgets
  • nk_combo / nk_combobox variants beyond the basic binding
  • nk_popup_* managed wrappers
  • nk_tooltip convenience API
  • nk_style_* full style struct access from C# (only uniform scaling is applied)
  • Multi-font support and glyph range selection
  • nk_list_view (field end is intentionally ignored by the generator)

Raw access through ctx.Native (the generated NkContext) is always available as a workaround for any missing wrapper.

Regenerating bindings

dotnet run --project Nuklear.Net.NativeGen/Nuklear.Net.NativeGen.csproj

Requires the native build for the host RID to already exist. Output is written to Nuklear.Net.Native/Generated/.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Nuklear.Net.Native:

Package Downloads
Nuklear.Net

.NET bindings for the Nuklear immediate-mode GUI library.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 95 5/26/2026
1.0.0 91 5/26/2026