これは、最小状態のイミディエイトモードのグラフィカルユーザーインターフェイスツールキットです。 ANSI Cで書かれ、パブリックドメインでライセンスされています。シンプルなものとして設計されました アプリケーションの埋め込み可能なユーザーインターフェイスであり、依存関係はありません。 デフォルトのレンダリングバックエンドまたはOSウィンドウ/入力処理を提供しますが、代わりに 高度にモジュール化されたライブラリベースのアプローチで、入力の単純な入力状態と プリミティブ形状を出力として記述する描画コマンド。したがって、提供する代わりに 多数のプラットフォームを抽象化しようとする階層化されたライブラリと バックエンドをレンダリングし、実際のUIにのみ焦点を当てます。
このライブラリは1つのヘッダーファイルに自己完結しており、次のいずれかで使用できます。 ヘッダーのみモードまたは実装モード。ヘッダーのみモードが使用されます デフォルトで含まれ、このヘッダーを他のヘッダーに含めることができます 実際の実装は含まれていません。
インプリメンテーションモードでは、このファイルを作成する前に、1つの.c/.cppファイルでプリプロセッサマクロを定義する必要があります。
NK_IMPLEMENTATION
#include
#define NK_IMPLEMENTATION
#include "nuklear.h"
重要: "nuklear.h" をインクルードするたびに、同じオプションのフラグを定義する必要があります。 これは非常に重要です。これを行わないと、コンパイラエラーが発生したり、さらに悪いことにスタックが破損したりします。
/* 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);
他の著者によって作成されたさまざまな言語用の核結合がいくつかあります。 私は必ずしもこれらのいずれにも堪能ではないので、私は彼らの品質を証明することはできません 言語。さらに、すべてのバインディングが常に最新の状態に保たれるという保証はありません。
Micha MettkeとGitHubへのすべての直接的または間接的な貢献者によって開発されました。
埋め込み、およびショーン・バレット(パブリックドメイン) トリスタン・グリマー(MITライセンス)による埋め込みフォント。
stb_texedit
stb_truetype
stb_rectpack
ProggyClean.ttf
オマール・コルナット(ocornut@github)のimguiライブラリに感謝します。 このライブラリのインスピレーションを与えてくれた、手作りのヒーローのためのケイシー・ムラトリ そして彼のオリジナルのイミディエイトモードのグラフィカルユーザーインターフェイスのアイデアとショーン 私の信仰を回復した彼の素晴らしいシングルヘッダーライブラリのためのバレット 図書館で、私自身のいくつかを作成するように私を連れてきました。最後に、シングルヘッダーのファイルパッカー用のアプールバジョシ。
------------------------------------------------------------------------------ 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. -----------------------------------------------------------------------------
プルリクエストをレビューするとき、レビュー担当者が保持すべき一般的なものがあります 念頭に置いて。
に対する変更の確認と:
src/*
nuklear.h
nuklear.h
{}
リポジトリ内の 、およびその他のファイルへの変更を確認する:
demo/*
example/*
demo
example
nuklear.h