Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
N

nuklear

> 编程语言
Open source

A single-header ANSI C gui library

14.0K stars0 likes2 views
WebsiteGitHub

About

A single-header ANSI C gui library

Nuklear

ALL DEVELOPMENT MOVED ELSEWHERE

Dear visitor,

this repository, issue tracker, etc. is abandoned in favor of https://github.com/Immediate-Mode-UI/Nuklear . Any activity in this issue tracker, any pull requests, etc. will be ignored.

Looking forward to hearing from you in https://github.com/Immediate-Mode-UI/Nuklear

Nuklear community This is a minimal state immediate mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window and input handling but instead provides a very modular library approach by using simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends it only focuses on the actual UI.

Features

  • Immediate mode graphical user interface toolkit
  • Single header library
  • Written in C89 (ANSI C)
  • Small codebase (~18kLOC)
  • Focus on portability, efficiency and simplicity
  • No dependencies (not even the standard library if not wanted)
  • Fully skinnable and customizable
  • Low memory footprint with total memory control if needed or wanted
  • UTF-8 support
  • No global or hidden state
  • Customizable library modules (you can compile and use only what you need)
  • Optional font baker and vertex buffer output
  • Documentation

Building

This library is self contained in one single header file and can be used either in header only mode or in implementation mode. The header only mode is used by default when included and allows including this header in other headers and does not contain the actual implementation.

The implementation mode requires to define the preprocessor macro NK_IMPLEMENTATION in one .c/.cpp file before #includeing this file, e.g.:

c
#define NK_IMPLEMENTATION
#include "nuklear.h"

IMPORTANT: Every time you include "nuklear.h" you have to define the same optional flags. This is very important not doing it either leads to compiler errors or even worse stack corruptions.

Gallery

Example

…

Bindings

There are a number of nuklear bindings for different languges created by other authors. I cannot atest for their quality since I am not necessarily proficient in either of these languages. Furthermore there are no guarantee that all bindings will always be kept up to date:

  • Java by Guillaume Legris
  • D by Mateusz Muszyński
  • Golang by [email protected]
  • Rust by [email protected]
  • Chicken by [email protected]
  • Nim by [email protected]
  • Lua
    • LÖVE-Nuklear by Kevin Harrison
    • MoonNuklear by Stefano Trettel
  • Python
    • pyNuklear by William Emerison Six (ctypes-based wrapper)
    • pynk by [email protected] (cffi binding)
  • CSharp/.NET by [email protected]

Credits

Developed by Micha Mettke and every direct or indirect contributor to the GitHub.

Embeds stb_texedit, stb_truetype and stb_rectpack by Sean Barrett (public domain) Embeds ProggyClean.ttf font by Tristan Grimmer (MIT license).

Big thank you to Omar Cornut (ocornut@github) for his imgui library and giving me the inspiration for this library, Casey Muratori for handmade hero and his original immediate mode graphical user interface idea and Sean Barrett for his amazing single header libraries which restored my faith in libraries and brought me to create some of my own. Finally Apoorva Joshi for his singe-header file packer.

License

…

Issues· 236 open

View all issuesOpen on GitHub
  • #941

    ALL DEVELOPMENT MOVED ELSEWHERE

    enhancementquestionUpdated Nov 26, 2019
  • #927

    Image created in memory triggers "if this triggers you forgot to add a font"

    Updated Nov 25, 2019
  • #532

    Multiline text in labels

    Updated Nov 22, 2019
  • #897

    How draw on a background?

    Updated Nov 20, 2019
  • #937

    Option for component shadow

    Updated Nov 15, 2019
  • #888

    How to compile sdl_opengles2 for android?

    Updated Nov 15, 2019
  • #936

    Suggestion: Center docs

    Updated Nov 11, 2019
  • #934

    the GDI+ version make the nk_button_color draw the rectangle with inner black lines

    Updated Nov 8, 2019
  • #905

    Change the whole library to not use any null-terminated strings

    Updated Nov 5, 2019
  • #933

    Get rid of scissors?

    Updated Nov 2, 2019

> Tags

Ccc89guiimgui

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言