jjYBdx4IL / nanogui

Minimalistic C++/Python UI library for OpenGL/GLES/DX11/DX12/Vulkan

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NanoGUI

Docs Travis Build Status Appveyor Build Status Discord channel

NanoGUI is a minimalistic cross-platform widget library for OpenGL 3.x/DirectX11[12]/Vulkan. It supports automatic layout generation, stateful C++11 lambdas callbacks, a variety of useful widget types and Retina-capable rendering on Apple devices thanks to NanoVG by Mikko Mononen. Python bindings of all functionality are provided using pybind11.

Contents

Example screenshots (Dx11, Dx12, Vulkan, OpenGL)

Screenshot of Dx11 backend.

Honsu timetracker

Screenshot of OpenGL backend.

Extensions

Editor

image

DropdownBox

image

Description

NanoGUI builds on GLFW/Win32 native (dx11/12) for cross-platform context creation and event handling, and NanoVG to draw 2D primitives.

Note that the dependency library NanoVG already includes some basic example code to draw good-looking static widgets; what NanoGUI does is to flesh it out into a complete GUI toolkit with event handling, layout generation, etc.

NanoGUI currently works on Mac OS X (Clang) Linux (GCC or Clang) and Windows (Visual Studio ≥ 2015); it requires a recent C++11 capable compiler. All dependencies are jointly built using a CMake-based build system.

Creating widgets

NanoGUI makes it easy to instantiate widgets, set layout constraints, and register event callbacks using high-level C++11 code. For instance, the following two lines from the included example application add a new button to an existing window window and register an event callback.

The following lines from the example application create the coupled slider and text box on the bottom of the second window (see the screenshot).

The Python version of this same piece of code looks like this:

"Simple mode"

Christian Schüller contributed a convenience class that makes it possible to create AntTweakBar-style variable manipulators using just a few lines of code. For instance, the source code below was used to create the following example application.

Screenshot

Compiling

Clone the repository and all dependencies (with git clone --recursive), run CMake to generate Makefiles or CMake/Visual Studio project files, and the rest should just work automatically.

On Debian/Ubuntu, make sure that you have installed the following packages

To also get the Python bindings, you'll need to run

On RedHat/Fedora, make sure that you have installed the following packages

To also get the Python bindings, you'll need to run

To build editor, you will need to run

License

NanoGUI is provided under a BSD-style license that can be found in the LICENSE file. By using, distributing, or contributing to this project, you agree to the terms and conditions of this license.

NanoGUI uses Daniel Bruce's Entypo+ font for the icons used on various widgets. This work is licensed under a CC BY-SA 4.0 license. Commercial entities using NanoGUI should consult the proper legal counsel for how to best adhere to the attribution clause of the license.

About

Minimalistic C++/Python UI library for OpenGL/GLES/DX11/DX12/Vulkan

License:Other


Languages

Language:C++ 79.7%Language:C 19.2%Language:CMake 0.5%Language:Python 0.4%Language:GLSL 0.1%Language:Shell 0.0%Language:Objective-C 0.0%Language:Objective-C++ 0.0%