Skip to content

EldritchCodex/Nodens

Repository files navigation

nodens-banner3

Introduction

Nodens is a simple, modern C++ framework designed for quickly developing interactive desktop applications with a immediate mode graphical user interface.

Built upon C++23 standards, the framework unifies amazing third-party libraries, like ImGui and Tracy, with a custom, multithreaded core, providing a robust foundation for rapid development/prototyping of interactive applications ranging from simple tools to game engines.

Key Features

🖥️ Core Architecture

  • Modern C++ Standard: Built using C++20/23 features (e.g. std::jthread, std::stop_token, concepts and std::to_underlying).
  • Layer Stack System: Flexible application flow control allowing for modular updates and rendering layers (e.g., overlay, game world, UI).
  • Window Management: cross-platform windowing and input polling via GLFW.

⚡ Concurrency & Events

  • Multithreaded Job System: A custom thread pool implementation utilizing C++20 std::jthread for automatic joining and std::future for asynchronous task management.
  • Asynchronous Event Bus: A thread-safe Publish/Subscribe system allowing decoupled communication between subsystems. Supports generic event types and lambda listeners.

🎨 Graphics & GUI

  • Immediate Mode GUI: Fully integrated ImGui with Docking and Viewport support enabled by default.
  • Data Visualization: Native support for high-performance 2D and 3D plotting via ImPlot and ImPlot3D.
  • Rendering Backend: OpenGL context management initialized via GLAD.

🛠️ Profiling & Debugging

  • Integrated Frame Profiling: Built-in support for Tracy Profiler (v0.13.0) to analyze frame time, memory usage, and lock contention in real-time.

Getting Started

Prerequisites

  • C++ Compiler: A compiler with C++23 support.
  • CMake: Version 3.8 or higher.

Cloning

To clone the repository run the command

git clone https://github.com/EldritchCodex/Nodens.git --recursive

Example Applications

Examples of application codes are provided in the examples/ folder.

circularwave3d

  • Demonstrates: Immediate Mode GUI Rendering, 2D/3D Plotting, Profiling.
  • Description: A visual demo that renders real-time mathematical functions. It calculates sine and cosine waves every frame and visualizes them using ImPlot (for 2D graphs) and ImPlot3D (for 3D line plots).

jobsystem

  • Demonstrates: Multithreading, std::future integration, Non-blocking UI.
  • Description: A control panel for the internal thread pool. It allows the user to submit a "Heavy Calculation" (simulated by a 2-second thread sleep) to a background worker. The main thread polls the std::future status each frame to check for completion without freezing the GUI, updating the status text from "Processing..." to "Idle" once finished.

asyncevent

  • Demonstrates: Pub/Sub Architecture, Thread-safe Data Gathering, Live Analytics.
  • Description: A simulation of a "Deep Space Analytics" tool. It uses the event bus to decouple the UI from the logic:
    • Publisher: Buttons on the UI publish PlanetaryScanEvents.
    • Subscriber: A background worker listens for these events, simulates a randomized workload (variable sleep time), generates "scientific data" (distance/atmosphere density), and reports the results back.
    • Visualization: The main thread safely locks the data mutex to render the incoming results on a scatter plot and a latency graph in real-time.
Showcasing performance profiling for multithreaded workloads
example-tracy-profiling-multithread.mp4

Applications Showcase

Demonstrations of the Nodens framework in action, featuring real-time interactive simulations.

1D.Simulation.Engine.mp4
2D.Simulation.Engine.mp4

References

Dependencies

Library Role / Domain Description Integration Method Version/Branch/Tag
GLAD Graphics Core OpenGL function loader. Generated / External v0.1.35
GLFW System & Input Cross-platform for window, context, and input management. Git Submodule v3.4
GLM Mathematics Header-only mathematics library. Git Submodule v1.0.2
ImGui UI / Tools Bloat-free Immediate Mode GUI. Git Submodule v1.92.5-docking
ImPlot Visualization 2D data plotting extension for ImGui. Git Submodule v0.17
ImPlot3D Visualization 3D data plotting extension for ImGui. Git Submodule v0.3
SPDLog Utilities Fast, header-only/compiled logging library. Git Submodule v1.16.0
Tracy Profiling Real-time frame profiler. Git Submodule v0.13.0

Literature

[1] The Cherno (no date) Game Engine Series, YouTube. Available at: http://www.youtube.com/playlist?list=PLlrATfBNZ98dC-V-N3m0Go4deliWHPFwT.

[2] Gregory, J. (2019) Game Engine Architecture. Third edition. CRC Press.

[3] Horton, I. and Van Weert, P. (2023) Beginning C++23: From Beginner to Pro. Berkeley, CA: Apress. Available at: https://doi.org/10.1007/978-1-4842-9343-0.

[4] Angel, E. and Shreiner, D. (2012) Interactive computer graphics: a top-down approach with shader-based OpenGL. 6th ed. Boston: Addison-Wesley.

About

A modern C++ framework for prototyping interactive desktop application.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published