nuklear(A single-header ANSI C gui library,界面还不错)
Nuklear
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 #include
ing this file, e.g.:
#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
/* init gui state */
struct nk_context ctx;
nk_init_fixed(&ctx, calloc(1, MAX_MEMORY), MAX_MEMORY, &font); enum {EASY, HARD};
static int op = EASY;
static float value = 0.6f;
static int i = 20; if (nk_begin(&ctx, "Show", nk_rect(50, 50, 220, 220),
NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) {
/* fixed widget pixel width */
nk_layout_row_static(&ctx, 30, 80, 1);
if (nk_button_label(&ctx, "button")) {
/* event handling */
} /* fixed widget window ratio width */
nk_layout_row_dynamic(&ctx, 30, 2);
if (nk_option_label(&ctx, "easy", op == EASY)) op = EASY;
if (nk_option_label(&ctx, "hard", op == HARD)) op = HARD; /* custom widget pixel width */
nk_layout_row_begin(&ctx, NK_STATIC, 30, 2);
{
nk_layout_row_push(&ctx, 50);
nk_label(&ctx, "Volume:", NK_TEXT_LEFT);
nk_layout_row_push(&ctx, 110);
nk_slider_float(&ctx, 0, &value, 1.0f, 0.1f);
}
nk_layout_row_end(&ctx);
}
nk_end(&ctx);
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
- Golang by golang-ui@github.com
- Rust by snuk182@github.com
- Chicken by wasamasa@github.com
- Nim by zacharycarter@github.com
- Lua/Löve2d by Kevin Harrison
- Python by William Emerison Six
- CSharp/.NET by cartman300@github.com
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.
https://github.com/vurtun/nuklear
nuklear(A single-header ANSI C gui library,界面还不错)的更多相关文章
- header 跳转时报错误。Header may not contain more than a single header, new line detected
我在用php的header做跳转时,报错误. Header may not contain more than a single header, new line detected 先贴一下代码: c ...
- Quartz(GUI)图形界面程序----Quartz Web
下载.设置和运行Quartz(GUI)图形界面程序----Quartz Web 一.获取Quartz Web程序(Quartz GUI).早期的 Quartz 框架开发者意识到一个 GUI 对于某类用 ...
- centOS7下安装GUI图形界面
1.如何在centOS7下安装GUI图形界面 当你安装centOS7服务器版本的时候,系统默认是不会安装GUI的图形界面程序,这个需要手动安装CentOS7 Gnome GUI包. 2.在系统下使用命 ...
- CentOS7安装GUI图形界面
本文转自centOS7下安装GUI图形界面,侵权删. 1. 在命令行下 输入下面的命令来安装Gnome包. # yum groupinstall "GNOME Desktop" & ...
- CentOS7 下安装GUI图形界面GNOME
在安装Gnome包之前,需要检查一下网络是否有网络(使用ping www.baidu.com) 一.先装X windows,-y表示参数同意所有软件安装操,当出现 Complete!说明这里安装成功了 ...
- 我发起了一个 .Net 开源 跨平台 GUI (界面开发框架)项目 HtmlCore
大家好 , 我发起了一个 .Net 开源 跨平台 GUI (界面开发框架)项目 , 名字叫 HtmlCore . 项目的一个主要目标是可以用 .Net 在 移动设备 上 开发 GUI 程序 (界面程 ...
- CentOS7安装Gnome GUI图形界面
CentOS7安装Gnome GUI图形界面 最小化安装了.当时没 注意,后面一步步安装完了,结果直接启动到命令行模式了. 晕,又不想重新安装,直接想从命令行模式安装.在网上找了半天,终于找到一点小 ...
- Ubuntu: HDF5报错: HDF5 header version与HDF5 library不匹配
今天在执行一个用到hdf5的python脚本时,遇到如下错误 Warning! ***HDF5 library version mismatched error*** The HDF5 header ...
- golang gui library 库
andlabs/ui已经重写,稳定性增强,但是组件很少,只提供了几种基础的控件,慎用.gxui死了,别用.linuxdeepin转QT了,所以…… windows系统最好的选择是walk. 首先,写w ...
随机推荐
- 82.管道实现cgi内存多线程查询
总体思路就是客户端写入要查询的数据到管道中,服务器端从管道读取,然后写入随机文件,再把文件名写入管道,然后客户端再读取文件 服务器端 设置缓冲区大写,设置管道名字,以及标识有多少个线程等 //设置缓存 ...
- 含有打印、统计DataGridView(1)
using System;using System.Collections.Generic;using System.Text;using System.Drawing.Printing;using ...
- vue 自定义modal 模态框组件
参数名 类型 说明 visible Boolean 是否显示,默认false title String 标题 update:visible Boolean 更新visible, 使用:visible. ...
- 修饰器&高阶组件
一.修饰器 1.类的修饰 修饰器是一个函数,用来修改类的行为 function testable(target) { target.isTestable = true; } @testable cla ...
- (入门整理学习一)Asp.net core
1.安装.net code SDK,vs Code;vs code c#插件可在软件扩展 (我网盘有) vs2015上安装教程:http://www.cnblogs.com/wangrudong00 ...
- stm32的dma缓冲区长度,,存放数据数组会不会冲掉
- Oracle以系统管理员的方式登录失败
解决方法: 因为SYS是在数据库之外的超级管理员,所以我们在登录的时候输入sys后在输入命令:password as sysdba 就可以!例如:输入口令: m1234 as sysdba 参考文章 ...
- Android(Lollipop/5.0) Material Design(四) 创建列表和卡片
Material Design系列 Android(Lollipop/5.0)Material Design(一) 简单介绍 Android(Lollipop/5.0)Material Design( ...
- UCloud上LAMP小型站点搭建与測试
文件夹 介绍 LAMP环境搭建 打开UCloud防火墙 WordPress安装 应用測试 介绍 本篇博客旨在通过介绍搭建一个WordPress博客的过程介绍在UCloud的云主机(UHOST)上搭建单 ...
- 微信端 h5 视频 video 自动播放
document.addEventListener("WeixinJSBridgeReady",function(){ document.getElementById(" ...