{"id":13429766,"url":"https://github.com/wjakob/nanogui","last_synced_at":"2025-05-14T14:06:21.813Z","repository":{"id":26678087,"uuid":"30134765","full_name":"wjakob/nanogui","owner":"wjakob","description":"Minimalistic GUI library for OpenGL","archived":false,"fork":false,"pushed_at":"2023-04-28T13:40:49.000Z","size":4801,"stargazers_count":4748,"open_issues_count":115,"forks_count":617,"subscribers_count":169,"default_branch":"master","last_synced_at":"2025-04-11T06:13:13.710Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wjakob.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-02-01T03:16:12.000Z","updated_at":"2025-04-09T11:31:16.000Z","dependencies_parsed_at":"2022-07-09T05:00:32.316Z","dependency_job_id":"29d4b101-b0de-4881-a384-1462a4e99348","html_url":"https://github.com/wjakob/nanogui","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wjakob%2Fnanogui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wjakob%2Fnanogui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wjakob%2Fnanogui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wjakob%2Fnanogui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wjakob","download_url":"https://codeload.github.com/wjakob/nanogui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254159176,"owners_count":22024558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T02:00:45.005Z","updated_at":"2025-05-14T14:06:21.770Z","avatar_url":"https://github.com/wjakob.png","language":"C++","funding_links":[],"categories":["C++","C/C++","GUI","User Interaction","Graphics","[Libraries](#contents)"],"sub_categories":["GUI","Graphical User Interface"],"readme":"NanoGUI\n========================================================================================\n|docs| |travis| |appveyor|\n\n.. |docs| image:: https://readthedocs.org/projects/nanogui/badge/?version=latest\n    :target: http://nanogui.readthedocs.org/en/latest/?badge=latest\n    :alt: Docs\n\n.. |travis| image:: https://travis-ci.org/wjakob/nanogui.svg?branch=master\n   :target: https://travis-ci.org/wjakob/nanogui\n   :alt: Travis Build Status\n\n.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/m8h3uyvdb4ej2i02/branch/master?svg=true\n   :target: https://ci.appveyor.com/project/wjakob/nanogui/branch/master\n   :alt: Appveyor Build Status\n\n.. begin_brief_description\n\nNanoGUI is a minimalistic cross-platform widget library for OpenGL 3.x or higher. It\nsupports automatic layout generation, stateful C++11 lambdas callbacks, a variety of\nuseful widget types and Retina-capable rendering on Apple devices thanks to NanoVG_ by\nMikko Mononen. Python bindings of all functionality are provided using pybind11_.\n\n*Note*: this repository is currently in maintenance-only mode. A new and\nsignificantly modernized/refactored version of NanoGUI with features such as\nMetal/GLES/WebAssembly support is available `here\n\u003chttps://github.com/mitsuba-renderer/nanogui\u003e`_.\n\n.. _NanoVG: https://github.com/memononen/NanoVG\n.. _pybind11: https://github.com/wjakob/pybind11\n\n.. end_brief_description\n\n- `Documentation \u003chttps://nanogui.readthedocs.io\u003e`_\n\n.. contents:: Contents\n   :local:\n   :backlinks: none\n\nExample screenshot\n----------------------------------------------------------------------------------------\n\n.. image:: https://github.com/wjakob/nanogui/raw/master/resources/screenshot.png\n   :alt: Screenshot of Example 1.\n   :align: center\n\nDescription\n----------------------------------------------------------------------------------------\n\n.. begin_long_description\n\nNanoGUI builds on GLFW_ for cross-platform OpenGL context creation and event handling,\nGLAD_ to use OpenGL 3.x or higher Windows, Eigen_ for basic vector types, and NanoVG_ to\ndraw 2D primitives.\n\nNote that the dependency library NanoVG already includes some basic example code to draw\ngood-looking static widgets; what NanoGUI does is to flesh it out into a complete GUI\ntoolkit with event handling, layout generation, etc.\n\nNanoGUI currently works on Mac OS X (Clang) Linux (GCC or Clang) and Windows (Visual\nStudio ≥ 2015); it requires a recent C++11 capable compiler. All dependencies are\njointly built using a CMake-based build system.\n\n.. _GLFW: http://www.glfw.org/\n.. _GLAD: https://github.com/Dav1dde/glad\n.. _Eigen: http://eigen.tuxfamily.org/index.php?title=Main_Page\n\n.. end_long_description\n\nCreating widgets\n----------------------------------------------------------------------------------------\n\nNanoGUI makes it easy to instantiate widgets, set layout constraints, and\nregister event callbacks using high-level C++11 code. For instance, the\nfollowing two lines from the included example application add a new button to\nan existing window `window` and register an event callback.\n\n.. code-block:: cpp\n\n   Button *b = new Button(window, \"Plain button\");\n   b-\u003esetCallback([] { cout \u003c\u003c \"pushed!\" \u003c\u003c endl; });\n\n\nThe following lines from the example application create the coupled\nslider and text box on the bottom of the second window (see the screenshot).\n\n.. code-block:: cpp\n\n   /* Create an empty panel with a horizontal layout */\n   Widget *panel = new Widget(window);\n   panel-\u003esetLayout(new BoxLayout(BoxLayout::Horizontal, BoxLayout::Middle, 0, 20));\n\n   /* Add a slider and set defaults */\n   Slider *slider = new Slider(panel);\n   slider-\u003esetValue(0.5f);\n   slider-\u003esetFixedWidth(80);\n\n   /* Add a textbox and set defaults */\n   TextBox *textBox = new TextBox(panel);\n   textBox-\u003esetFixedSize(Vector2i(60, 25));\n   textBox-\u003esetValue(\"50\");\n   textBox-\u003esetUnits(\"%\");\n\n   /* Propagate slider changes to the text box */\n   slider-\u003esetCallback([textBox](float value) {\n       textBox-\u003esetValue(std::to_string((int) (value * 100)));\n   });\n\n\nThe Python version of this same piece of code looks like this:\n\n.. code-block:: py\n\n   # Create an empty panel with a horizontal layout\n   panel = Widget(window)\n   panel.setLayout(BoxLayout(BoxLayout.Horizontal, BoxLayout.Middle, 0, 20))\n\n   # Add a slider and set defaults\n   slider = Slider(panel)\n   slider.setValue(0.5f)\n   slider.setFixedWidth(80)\n\n   # Add a textbox and set defaults\n   textBox = TextBox(panel)\n   textBox.setFixedSize(Vector2i(60, 25))\n   textBox.setValue(\"50\")\n   textBox.setUnits(\"%\")\n\n   # Propagate slider changes to the text box\n   def cb(value):\n       textBox.setValue(\"%i\" % int(value * 100))\n   slider.setCallback(cb)\n\n\"Simple mode\"\n----------------------------------------------------------------------------------------\n\nChristian Schüller contributed a convenience class that makes it possible to\ncreate AntTweakBar-style variable manipulators using just a few lines of code.\nFor instance, the source code below was used to create the following example\napplication.\n\n.. image:: https://github.com/wjakob/nanogui/raw/master/resources/screenshot2.png\n   :alt: Screenshot\n   :align: center\n\n\n.. code-block:: cpp\n\n   /// dvar, bar, strvar, etc. are double/bool/string/.. variables\n\n   FormHelper *gui = new FormHelper(screen);\n   ref\u003cWindow\u003e window = gui-\u003eaddWindow(Eigen::Vector2i(10, 10), \"Form helper example\");\n   gui-\u003eaddGroup(\"Basic types\");\n   gui-\u003eaddVariable(\"bool\", bvar);\n   gui-\u003eaddVariable(\"string\", strvar);\n\n   gui-\u003eaddGroup(\"Validating fields\");\n   gui-\u003eaddVariable(\"int\", ivar);\n   gui-\u003eaddVariable(\"float\", fvar);\n   gui-\u003eaddVariable(\"double\", dvar);\n\n   gui-\u003eaddGroup(\"Complex types\");\n   gui-\u003eaddVariable(\"Enumeration\", enumval, enabled)\n      -\u003esetItems({\"Item 1\", \"Item 2\", \"Item 3\"});\n   gui-\u003eaddVariable(\"Color\", colval);\n\n   gui-\u003eaddGroup(\"Other widgets\");\n   gui-\u003eaddButton(\"A button\", [](){ std::cout \u003c\u003c \"Button pressed.\" \u003c\u003c std::endl; });\n\n   screen-\u003esetVisible(true);\n   screen-\u003eperformLayout();\n   window-\u003ecenter();\n\nCompiling\n----------------------------------------------------------------------------------------\n\nClone the repository and all dependencies (with ``git clone --recursive``),\nrun CMake to generate Makefiles or CMake/Visual Studio project files, and\nthe rest should just work automatically.\n\nOn Debian/Ubuntu, make sure that you have installed the following packages\n\n.. code-block:: bash\n\n   $ apt-get install cmake xorg-dev libglu1-mesa-dev\n\nTo also get the Python bindings, you'll need to run\n\n.. code-block:: bash\n\n   $ apt-get install python-dev\n\nOn RedHat/Fedora, make sure that you have installed the following packages\n\n.. code-block:: bash\n\n   $ sudo dnf install cmake mesa-libGLU-devel libXi-devel libXcursor-devel libXinerama-devel libXrandr-devel xorg-x11-server-devel\n\nTo also get the Python bindings, you'll need to run\n\n.. code-block:: bash\n\n   $ sudo dnf install python3-devel\n\nLicense\n----------------------------------------------------------------------------------------\n\n.. begin_license\n\nNanoGUI is provided under a BSD-style license that can be found in the LICENSE_\nfile. By using, distributing, or contributing to this project, you agree to the\nterms and conditions of this license.\n\n.. _LICENSE: https://github.com/wjakob/nanogui/blob/master/LICENSE.txt\n\nNanoGUI uses Daniel Bruce's `Entypo+ \u003chttp://www.entypo.com/\u003e`_ font for the\nicons used on various widgets.  This work is licensed under a\n`CC BY-SA 4.0 \u003chttps://creativecommons.org/licenses/by-sa/4.0/\u003e`_ license.\nCommercial entities using NanoGUI should consult the proper legal counsel for\nhow to best adhere to the attribution clause of the license.\n\n.. end_license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwjakob%2Fnanogui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwjakob%2Fnanogui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwjakob%2Fnanogui/lists"}