# teddyara/wyvern architecture

> Architecture diagram of the GitHub repository teddyara/wyvern, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/teddyara/wyvern
- Repository: https://github.com/teddyara/wyvern

## Overview

##### Project type and purpose
- It integrates windowing (GLFW), extension loading (GLEW), a real‐time renderer, basic physics, UI widgets, and an undo/redo command system.
- Its likely use case is authoring or manipulating a 3D world in real time.

##### File structure
- Top-level directories:
- Wyvern/Dependencies – external libraries (GLEW, GLFW) for OpenGL context, extensions, and input
- Wyvern/src – all C++ source: divided into subsystems
- Wyvern/Debug, x64/Debug – build outputs and assets (shaders under assets/)
- Sub‐folders under src expose architectural layers:
- core classes (Application, Window, Input, World, Transform, Viewport, Camera)
- renderer (buffers, shaders, framebuffers, skybox, debug overlays)
- physics (colliders, physics engine, hit detection)
- ui (widgets, title bar, toolbars, menus, zone layouts)
- cmds (Command pattern, concrete commands + Undo/Redo, HistoryManager)
- behaviours (pluggable scene behaviours, e.g., camera control)
- Presence of .sln / .vcxproj indicates a Visual Studio solution.

##### README for additional insights
- No architecture sections provided. All domain insights must come from code organization.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Dependencies
    GLFW["GLFW"]:::external
    GLEW["GLEW"]:::external

    %% Core Application Layer
    subgraph "Core Application Layer"
        Main["main.cpp"]:::core
        Application["Application"]:::core
        Window["Window & Viewport"]:::core
        Input["Input"]:::core
        Interaction["InteractionController"]:::core
        Camera["Camera"]:::core
    end

    %% World & Scene Graph
    subgraph "World Model & Scene Graph"
        World["World"]:::data
        Transform["Transform"]:::data
        Tools["TransformTools"]:::data
        Behaviours["Behaviours"]:::data
    end

    %% Command & History Subsystem
    subgraph "Command & History Subsystem"
        ICommand["ICommand & Templates"]:::subsystem
        History["HistoryManager"]:::subsystem
        Commands["Concrete Commands"]:::subsystem
    end

    %% Rendering Subsystem
    subgraph "Rendering Subsystem"
        Renderer["Renderer"]:::subsystem
        Buffers["Buffer & Framebuffer"]:::subsystem
        Shaders["Shader & Texture"]:::subsystem
        SkyDebug["Skybox & DebugOverlay"]:::subsystem
    end

    %% Physics Subsystem
    subgraph "Physics Subsystem"
        Physics["Physics Engine"]:::subsystem
        BoxColl["BoxCollider"]:::subsystem
        CylColl["CylinderCollider"]:::subsystem
        HitInfo["HitInfo"]:::subsystem
    end

    %% UI Layer
    subgraph "UI Layer"
        Widgets["UIWidget & Layouts"]:::subsystem
        FontMgr["FontManager"]:::subsystem
    end

    %% Connections - Main Loop
    Main --> Application
    Application --> Input
    Application --> Physics
    Application --> Renderer
    Application --> Widgets
    Application --> History

    %% Input & Commands Flow
    Input --> Interaction
    Interaction --> Commands
    Commands --> History
    History --> World

    %% Physics Flow
    Physics --> World
    BoxColl --> Physics
    CylColl --> Physics
    HitInfo --> Physics

    %% Rendering Flow
    GLEW --> Renderer
    Renderer --> World
    Renderer --> Buffers
    Renderer --> Shaders
    Renderer --> SkyDebug

    %% UI Flow
    Widgets --> FontMgr
    Widgets --> Renderer

    %% World Graph Details
    World --> Transform
    World --> Tools
    World --> Behaviours

    %% External Integration
    GLFW --> Window
    GLFW --> Input

    %% Click Events
    click GLFW "https://github.com/teddyara/wyvern/tree/main/Wyvern/Dependencies/GLFW"
    click GLEW "https://github.com/teddyara/wyvern/tree/main/Wyvern/Dependencies/GLEW"
    click Application "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/Application.h"
    click Main "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/main.cpp"
    click Window "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/Window.h"
    click Input "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/Input.h"
    click Interaction "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/InteractionController.h"
    click Camera "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/Camera.h"
    click World "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/World.h"
    click Transform "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/Transform.h"
    click Tools "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/TransformTools.h"
    click Behaviours "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/behaviours/Behaviour.h"
    click History "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/HistoryManager.h"
    click ICommand "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/cmds/ICommand.h"
    click Commands "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/cmds/CommandTemplate.h"
    click Renderer "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/renderer/Renderer.h"
    click Buffers "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/renderer/Buffer.h"
    click Shaders "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/renderer/Shader.h"
    click SkyDebug "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/renderer/Skybox.h"
    click Physics "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/physics/Physics.h"
    click BoxColl "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/physics/BoxCollider.h"
    click CylColl "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/physics/CylinderCollider.h"
    click HitInfo "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/physics/HitInfo.h"
    click Widgets "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/ui/UIWidget.h"
    click FontMgr "https://github.com/teddyara/wyvern/blob/main/Wyvern/src/FontManager.h"

    %% Styles
    classDef external fill:#ddd,stroke:#bbb
    classDef core fill:#bbf,stroke:#88f
    classDef subsystem fill:#bfb,stroke:#4c4
    classDef data fill:#ffc,stroke:#fc0
```
