nuklear/Readme.md

168 lines
8.2 KiB
Markdown
Raw Permalink Normal View History

2017-02-24 13:18:27 -05:00
# Nuklear
[![Build Status](https://travis-ci.org/vurtun/nuklear.svg)](https://travis-ci.org/vurtun/nuklear)
2015-11-19 15:02:36 -05:00
This is a minimal state immediate mode graphical user interface toolkit
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
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,
2018-02-10 13:30:53 -05:00
a default render backend or OS window and input handling but instead provides a very modular
2015-12-10 18:04:17 -05:00
library approach by using simple input state for input and draw
2015-09-17 11:31:43 -04:00
commands describing primitive shapes as output. So instead of providing a
layered library that tries to abstract over a number of platform and
2015-11-19 15:02:36 -05:00
render backends it only focuses on the actual UI.
2015-03-11 09:00:59 -04:00
2015-03-14 12:05:30 -04:00
## Features
2017-02-24 13:18:27 -05:00
2015-04-16 10:20:00 -04:00
- Immediate mode graphical user interface toolkit
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
- Single header library
2015-03-14 12:05:30 -04:00
- Written in C89 (ANSI C)
2017-08-19 18:45:46 -04:00
- Small codebase (~18kLOC)
- Focus on portability, efficiency and simplicity
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
- No dependencies (not even the standard library if not wanted)
- Fully skinnable and customizable
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
- Low memory footprint with total memory control if needed or wanted
2015-04-30 10:12:21 -04:00
- UTF-8 support
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
- No global or hidden state
2016-04-19 04:23:33 -04:00
- Customizable library modules (you can compile and use only what you need)
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
- Optional font baker and vertex buffer output
2018-01-07 11:30:37 -05:00
- [Documentation](https://rawgit.com/vurtun/nuklear/master/doc/nuklear.html)
2015-11-19 15:02:36 -05:00
## Building
2017-02-24 13:18:27 -05:00
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
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.:
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
```c
#define NK_IMPLEMENTATION
#include "nuklear.h"
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
```
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.
2015-09-17 11:31:43 -04:00
2015-05-09 09:22:23 -04:00
## Gallery
2017-02-24 13:18:27 -05:00
2015-12-12 05:53:15 -05:00
![screenshot](https://cloud.githubusercontent.com/assets/8057201/11761525/ae06f0ca-a0c6-11e5-819d-5610b25f6ef4.gif)
2016-03-04 14:46:45 -05:00
![screen](https://cloud.githubusercontent.com/assets/8057201/13538240/acd96876-e249-11e5-9547-5ac0b19667a0.png)
![screen2](https://cloud.githubusercontent.com/assets/8057201/13538243/b04acd4c-e249-11e5-8fd2-ad7744a5b446.png)
2015-09-19 11:59:10 -04:00
![node](https://cloud.githubusercontent.com/assets/8057201/9976995/e81ac04a-5ef7-11e5-872b-acd54fbeee03.gif)
2016-06-12 10:14:24 -04:00
![skinning](https://cloud.githubusercontent.com/assets/8057201/15991632/76494854-30b8-11e6-9555-a69840d0d50b.png)
2016-04-28 17:54:13 -04:00
![gamepad](https://cloud.githubusercontent.com/assets/8057201/14902576/339926a8-0d9c-11e6-9fee-a8b73af04473.png)
2015-05-09 09:22:23 -04:00
2015-04-25 10:44:43 -04:00
## Example
2017-02-24 13:18:27 -05:00
2015-04-25 10:44:43 -04:00
```c
2015-12-30 10:31:08 -05:00
/* init gui state */
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
struct nk_context ctx;
nk_init_fixed(&ctx, calloc(1, MAX_MEMORY), MAX_MEMORY, &font);
2015-12-30 10:31:08 -05:00
enum {EASY, HARD};
static int op = EASY;
static float value = 0.6f;
static int i = 20;
2015-12-30 10:31:08 -05:00
if (nk_begin(&ctx, "Show", nk_rect(50, 50, 220, 220),
2016-09-17 20:31:45 -04:00
NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) {
2016-01-04 15:34:48 -05:00
/* fixed widget pixel width */
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
nk_layout_row_static(&ctx, 30, 80, 1);
2016-09-17 20:31:45 -04:00
if (nk_button_label(&ctx, "button")) {
2016-01-04 15:34:48 -05:00
/* event handling */
2015-12-30 10:31:08 -05:00
}
2015-06-28 04:09:53 -04:00
2016-01-04 15:34:48 -05:00
/* fixed widget window ratio width */
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
nk_layout_row_dynamic(&ctx, 30, 2);
2016-09-17 20:31:45 -04:00
if (nk_option_label(&ctx, "easy", op == EASY)) op = EASY;
if (nk_option_label(&ctx, "hard", op == HARD)) op = HARD;
2016-01-04 15:34:48 -05:00
/* custom widget pixel width */
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
nk_layout_row_begin(&ctx, NK_STATIC, 30, 2);
2016-01-04 15:34:48 -05:00
{
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
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);
2015-04-25 10:44:43 -04:00
}
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
nk_layout_row_end(&ctx);
2015-04-25 10:44:43 -04:00
}
2016-09-17 20:31:45 -04:00
nk_end(&ctx);
2015-04-25 10:44:43 -04:00
```
2015-09-30 04:23:45 -04:00
![example](https://cloud.githubusercontent.com/assets/8057201/10187981/584ecd68-675c-11e5-897c-822ef534a876.png)
2015-04-25 10:44:43 -04:00
2017-02-24 13:18:27 -05:00
## 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:
2016-05-17 12:37:13 -04:00
2017-02-24 13:18:27 -05:00
- [Java](https://github.com/glegris/nuklear4j) by Guillaume Legris
- [Golang](https://github.com/golang-ui/nuklear) by golang-ui@github.com
- [Rust](https://github.com/snuk182/nuklear-rust) by snuk182@github.com
2018-01-08 23:52:18 -05:00
- [Chicken](https://github.com/wasamasa/nuklear) by wasamasa@github.com
2017-02-24 13:18:27 -05:00
- [Nim](https://github.com/zacharycarter/nuklear-nim) by zacharycarter@github.com
- Lua
- [LÖVE-Nuklear](https://github.com/keharriso/love-nuklear) by Kevin Harrison
- [MoonNuklear](https://github.com/stetre/moonnuklear) by Stefano Trettel
2018-03-24 13:20:26 -04:00
- Python
- [pyNuklear](https://github.com/billsix/pyNuklear) by William Emerison Six (ctypes-based wrapper)
- [pynk](https://github.com/nathanrw/nuklear-cffi) by nathanrw@github.com (cffi binding)
2018-01-08 23:55:25 -05:00
- [CSharp/.NET](https://github.com/cartman300/NuklearDotNet) by cartman300@github.com
2017-02-24 13:18:27 -05:00
## Credits
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
Developed by Micha Mettke and every direct or indirect contributor to the GitHub.
2018-02-11 06:28:19 -05:00
Embeds `stb_texedit`, `stb_truetype` and `stb_rectpack` by Sean Barrett (public domain)
Embeds `ProggyClean.ttf` font by Tristan Grimmer (MIT license).
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
2016-04-28 17:54:13 -04:00
Big thank you to Omar Cornut (ocornut@github) for his [imgui](https://github.com/ocornut/imgui) library and
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
giving me the inspiration for this library, Casey Muratori for handmade hero
and his original immediate mode graphical user interface idea and Sean
2018-02-11 06:28:19 -05:00
Barrett for his amazing single header [libraries](https://github.com/nothings/stb) which restored my faith
2018-04-02 12:41:52 -04:00
in libraries and brought me to create some of my own. Finally Apoorva Joshi for his singe-header [file packer](http://apoorvaj.io/single-header-packer.html).
Release Version 1.0 This is the first release version of nuklear (previously: zahnrad). As for those who no the old version will notice: a lot has changed. Most obvious should be the two biggest changes. First the name change because I got critique that the name is hard to comprehend and remember (understandable for non-germans) and the second is the transistion from four files (zahnrad.h, zahnrad.c, stb_truetype and stb_rect_pack) to one single header library file nuklear.h. I am not 100% convinced that using a single header library is the right choice here but so far I haven't encountered any problems. Noticable should be as well that nuklear now directly embeds three stb libraries: stb_truetype, stb_rect_pack and stb_textedit. Like in previous versions the first two are optional and the library can be compiled without. stb_textedit on the other hand powers the text edit implementation for single as well as multiline text manipulation. The text edit implementation is still relative new and untested so you can expect some bugs I have not found yet. In the demo department a lot changed as well. All platform demos now don't compile one big demo but instead contain a simple demo and small abstraction layer over the platform. Main benefit is better understandablity improved ease of use. The old demo is now split up and transfered into the example folder while each part is self contained and compileable. (All examples use glfw I don't now if this is the best platform but it is at least the simplest. I also removed the apple demo because I don't have an apple system and cannot make sure the new version runs with the old version. Finally a lot of small bugs have been fixed as well as bugs found by clang analyzer and coverity.
2016-04-10 19:34:59 -04:00
2017-02-24 13:18:27 -05:00
## License
2018-01-02 04:50:19 -05:00
```
------------------------------------------------------------------------------
This software is available under 2 licenses -- choose whichever you prefer.
------------------------------------------------------------------------------
ALTERNATIVE A - MIT License
Copyright (c) 2017 Micha Mettke
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
------------------------------------------------------------------------------
ALTERNATIVE B - Public Domain (www.unlicense.org)
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
software, either in source code form or as a compiled binary, for any purpose,
commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this
software dedicate any and all copyright interest in the software to the public
domain. We make this dedication for the benefit of the public at large and to
the detriment of our heirs and successors. We intend this dedication to be an
overt act of relinquishment in perpetuity of all present and future rights to
this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-----------------------------------------------------------------------------
2018-01-02 04:50:19 -05:00
```