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
<PackageReference Include="Nuklear.Net.Native" Version="1.0.1" />
<PackageVersion Include="Nuklear.Net.Native" Version="1.0.1" />
<PackageReference Include="Nuklear.Net.Native" />
paket add Nuklear.Net.Native --version 1.0.1
#r "nuget: Nuklear.Net.Native, 1.0.1"
#:package Nuklear.Net.Native@1.0.1
#addin nuget:?package=Nuklear.Net.Native&version=1.0.1
#tool nuget:?package=Nuklear.Net.Native&version=1.0.1
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 fromnk_convertRenderDrawCommand– 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_*widgetsnk_combo/nk_comboboxvariants beyond the basic bindingnk_popup_*managed wrappersnk_tooltipconvenience APInk_style_*full style struct access from C# (only uniform scaling is applied)- Multi-font support and glyph range selection
nk_list_view(fieldendis 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 | Versions 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. |
-
net10.0
- CppSharp.Runtime (>= 1.1.84.17100)
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.