Skip to content

Layer System

renanbomtempo edited this page Jun 10, 2026 · 1 revision

⚠️ This wiki is under construction. Pages are being populated incrementally.

Layer System

The Layer system is the primary abstraction for organizing application logic in Nodens. Every piece of update logic, rendering, or event handling lives inside a Layer.

Overview

Layer Lifecycle

Layer vs. Overlay

The LayerStack

Creating Your Own Layer

// MyLayer.cppm
export module MyApp.MyLayer;

import Nodens;

export class MyLayer : public Nodens::Layer {
public:
    MyLayer() : Layer("MyLayer") {}

    void OnAttach() override { /* initialization */ }
    void OnDetach() override { /* cleanup */ }
    void OnUpdate(Nodens::TimeStep ts) override { /* per-frame logic */ }
    void OnImGuiRender(Nodens::TimeStep ts) override { /* ImGui drawing */ }
    void OnEvent(Nodens::Event& event) override { /* event handling */ }
};

See Also

Clone this wiki locally