# anuken/arc architecture

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

- Interactive diagram: https://gitdiagram.com/anuken/arc
- Repository: https://github.com/anuken/arc

## Overview

##### Core Architecture Components

a) Core Layer (arc-core):
- Graphics System (Graphics.java, GL20/30)
- Input System (Input.java)
- File System (Files.java)
- Asset Management (AssetManager.java)
- Audio System (Audio.java, Soloud.java)
- Scene Graph (scene package)

b) Backend Layer:
- SDL Desktop Backend
- Android Backend
- iOS/RoboVM Backend
- Headless Backend

##### Extension Modules

Extensions in a separate section:
- Box2D Physics
- FreeType Font Rendering
- Visual Effects (fx)
- 3D Graphics (g3d)
- Networking (arcnet)
- Tiled Map Support
- File Dialogs
- Recording/Profiling Tools

##### Key Technical Elements

Important technical aspects:
- SDL as the desktop backend
- Soloud as the unified audio engine
- OpenGL rendering pipeline (GL20/30)
- Asset loading and management system
- Scene2D UI system

##### Implementation Details

Technical notes for:
- Native library bindings (JNI)
- Graphics state caching
- Batch rendering system
- Asset loading pipeline

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core["Core Layer"]
        Graphics["Graphics System"]
        OpenGL["OpenGL Wrapper"]
        Input["Input System"]
        FileSystem["File System"]
        Audio["Audio (Soloud)"]
        Assets["Asset Management"]
        Scene2D["Scene2D UI"]
        Math["Math/Utils"]

        Graphics --> OpenGL
        Scene2D --> Graphics
        Assets --> FileSystem
    end

    subgraph Backends["Backend Layer"]
        SDL["SDL (Desktop)"]
        Android["Android"]
        iOS["iOS (RoboVM)"]
        Headless["Headless"]
    end

    subgraph Extensions["Extensions Layer"]
        Box2D["Box2D Physics"]
        FreeType["FreeType Font"]
        ArcNet["Networking (ArcNet)"]
        FX["Graphics FX"]
        G3D["3D Graphics"]
        Tiled["Tiled Maps"]
        FileDialogs["File Dialogs"]
        Recording["Recording"]
        Profiling["Profiling"]
    end

    %% Backend connections
    SDL --> Core
    Android --> Core
    iOS --> Core
    Headless --> Core

    %% Extension connections
    Box2D -.-> Core
    FreeType -.-> Core
    ArcNet -.-> Core
    FX -.-> Graphics
    G3D -.-> Graphics
    Tiled -.-> Core
    FileDialogs -.-> Core
    Recording -.-> Core
    Profiling -.-> Core

    %% Click events for Core components
    click Graphics "https://github.com/Anuken/Arc/tree/master/arc-core/src/arc/graphics/"
    click OpenGL "https://github.com/Anuken/Arc/tree/master/arc-core/src/arc/graphics/gl/"
    click Input "https://github.com/Anuken/Arc/tree/master/arc-core/src/arc/input/"
    click FileSystem "https://github.com/Anuken/Arc/tree/master/arc-core/src/arc/files/"
    click Audio "https://github.com/Anuken/Arc/tree/master/arc-core/src/arc/audio/"
    click Assets "https://github.com/Anuken/Arc/tree/master/arc-core/src/arc/assets/"
    click Scene2D "https://github.com/Anuken/Arc/tree/master/arc-core/src/arc/scene/"
    click Math "https://github.com/Anuken/Arc/tree/master/arc-core/src/arc/math/"

    %% Click events for Backend components
    click SDL "https://github.com/Anuken/Arc/tree/master/backends/backend-sdl/src/arc/backend/sdl/"
    click Android "https://github.com/Anuken/Arc/tree/master/backends/backend-android/src/arc/backend/android/"
    click iOS "https://github.com/Anuken/Arc/tree/master/backends/backend-robovm/src/arc/backend/robovm/"
    click Headless "https://github.com/Anuken/Arc/tree/master/backends/backend-headless/src/arc/backend/headless/"

    %% Click events for Extension components
    click Box2D "https://github.com/Anuken/Arc/tree/master/extensions/box2d/src/arc/box2d/"
    click FreeType "https://github.com/Anuken/Arc/tree/master/extensions/freetype/src/arc/freetype/"
    click ArcNet "https://github.com/Anuken/Arc/tree/master/extensions/arcnet/src/arc/net/"
    click FX "https://github.com/Anuken/Arc/tree/master/extensions/fx/src/arc/fx/"
    click G3D "https://github.com/Anuken/Arc/tree/master/extensions/g3d/src/arc/graphics/g3d/"
    click Tiled "https://github.com/Anuken/Arc/tree/master/extensions/tiled/src/arc/maps/"
    click FileDialogs "https://github.com/Anuken/Arc/tree/master/extensions/filedialogs/src/arc/filedialogs/"
    click Recording "https://github.com/Anuken/Arc/tree/master/extensions/recorder/src/arc/gif/"
    click Profiling "https://github.com/Anuken/Arc/tree/master/extensions/profiling/src/arc/profiling/"

    %% Styling
    classDef core fill:#e1f5fe,stroke:#01579b
    classDef backend fill:#fff3e0,stroke:#ff6f00
    classDef extension fill:#f3e5f5,stroke:#7b1fa2

    class Graphics,OpenGL,Input,FileSystem,Audio,Assets,Scene2D,Math core
    class SDL,Android,iOS,Headless backend
    class Box2D,FreeType,ArcNet,FX,G3D,Tiled,FileDialogs,Recording,Profiling extension
```
