Nodens

← All projects

IFRAMEWORK experimental

Nodens

A C++23 framework for building interactive desktop applications quickly, with optional Dear ImGui. Everything is a C++ module, so an app starts with import nodens; and links one static library.

  • 01 · Windowing

    GLFW windows

    Creates the window, graphics context and input handling, with OpenGL or Vulkan backends.

  • 02 · Lifetime

    Layer system

    An app is a stack of layers. They update in order, draw back to front, and receive input from the top down.

  • 03 · Messaging

    Event system

    Input events pass down the layers. A thread-safe event bus lets any part publish and subscribe to custom events, handled immediately or queued.

  • 04 · Concurrency

    Task system

    Runs heavy work, like simulation and data processing, on worker threads so the render thread stays responsive.

  • 05 · Loop

    Window optional

    One loop services layers and events with a window and the ImGui overlay, with a window alone, or with no window at all. It is paced by an explicit policy: variable frame time by default, or fixed steps.

Writing an app

  • An app inherits from Nodens::Application, pushes one or more layers, and calls Run(). Every frame, each layer receives OnUpdate(TimeStep) and OnImGuiRender(TimeStep), and input events routed down the stack arrive in OnInputEvent.
  • Three examples ship with it: circularwave3d (live 2D/3D plots with ImPlot and ImPlot3D), planetaryscan (the event bus and task system working together) and headlesspulse (a loop with no window).
  • CMake builds every dependency from source, so there is nothing to install by hand.
HelloNodens.cpp a minimal app

                    
  • 01 · Modules

    Module-first

    Public APIs are C++ module interfaces (.cppm). Third-party headers stay in the global module fragment, so an app only ever writes import nodens;.

  • 02 · Delivery

    One static library

    The framework builds into a single static library, so the final product is one portable executable.

  • 03 · Platform

    Linux, on purpose

    The validated environment is Arch Linux. Native Windows and macOS builds are not supported.

How an app is organised

A few ideas carry most of an app. The guide goes deeper into each.

  • 01 · Layers

    Your app is a stack of layers

    A layer is a self-contained piece of the app: a simulation, a plot window, a debug panel. Each one sets itself up when it is added, reacts to input, updates every frame, draws its own interface, and cleans up when it is removed. Overlays such as the ImGui layer always draw on top.

  • 02 · Events

    Two ways to send a message

    Input and window events travel down the layers until one handles them. Events you define yourself go through an event bus: handled immediately, or queued and delivered once per frame on the main thread.

  • 03 · Tasks

    Heavy work off the main thread

    Simulation and data processing run on worker threads, and a finished task reports back through a queued event or a future. The main thread receives the result, so handlers never need locks of their own.

  • 04 · Profiling

    Tracy built in

    Add ZoneScoped to any function to see it in Tracy, including lock contention between workers and GPU timings on Vulkan.

  • 05 · Loop

    A window is optional

    Set the presentation to a window with ImGui, a window alone, or headless. The same loop runs the layers either way, and a layer can end it. Frame time is variable by default; fixed mode runs constant steps, which suits simulations.

Where it comes from

Nodens began as a personal project for my undergraduate Computer Graphics course at UFMG. Its foundations follow the early episodes of The Cherno's Game Engine series, and earlier iterations powered several of my academic projects, including boids and galaxians. Versions of it also ran the numerical simulation applications from my research, which are on my portfolio.

Examples

All three ship in the repository under examples/.

Example Shows
circularwave3d The immediate-mode GUI, with live 2D and 3D plots from ImPlot and ImPlot3D
planetaryscan The event bus and task system together, with thread-safe data collection and a live scatter plot
headlesspulse A loop with no window, ended by a layer, with fixed-step pacing as an option

Get started

References

↑ TOP