# sriman-dhar/computer-graphics-project-city-life architecture

> Architecture diagram of the GitHub repository sriman-dhar/computer-graphics-project-city-life, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sriman-dhar/computer-graphics-project-city-life
- Repository: https://github.com/sriman-dhar/computer-graphics-project-city-life

## Overview

This is a GLUT/OpenGL animated city-scene program. Its user-facing flow is a window displaying a city, with mouse input and timer-driven animation; the scene includes buildings, roads, weather, and moving vehicles including a train. The source is a single monolithic file, so the graph groups responsibilities within that file rather than implying separate modules. The README is empty and the source excerpt is partial, so audio-file usage and some callback wiring are not established.

Main entry points: [`A Reguler City Life 6/A Reguler City Life 6/main.cpp`](https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp) (Scene display)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_main["Window setup<br/>[main.cpp]"]
  node_display["Scene display<br/>[main.cpp]"]
  node_mouse["Mouse handler<br/>[main.cpp]"]
end

subgraph group_scene["City scene"]
  node_city["City backdrop<br/>[main.cpp]"]
  node_buildings["Buildings<br/>[main.cpp]"]
  node_roads["Roads<br/>[main.cpp]"]
  node_weather["Weather and sky<br/>[main.cpp]"]
  node_traffic["Vehicles and train<br/>[main.cpp]"]
end

subgraph group_motion["Animation"]
  node_timers["Timer callbacks<br/>[main.cpp]"]
  node_motionstate["Animation state<br/>[main.cpp]"]
end

node_user(("User"))
node_glut["GLUT"]
node_opengl["OpenGL"]

node_user -->|"interacts with"| node_glut
node_main -->|"initializes window"| node_glut
node_main -->|"registers display"| node_display
node_main -->|"registers mouse"| node_mouse
node_main -->|"registers timers"| node_timers
node_glut -->|"invokes display"| node_display
node_glut -->|"dispatches input"| node_mouse
node_timers -->|"updates state"| node_motionstate
node_display -->|"draws scene"| node_city
node_display -->|"draws buildings"| node_buildings
node_display -->|"draws roads"| node_roads
node_display -->|"draws weather"| node_weather
node_display -->|"draws traffic"| node_traffic
node_display -->|"issues draw calls"| node_opengl

click node_main "https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp"
click node_display "https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp"
click node_mouse "https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp"
click node_city "https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp"
click node_buildings "https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp"
click node_roads "https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp"
click node_weather "https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp"
click node_traffic "https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp"
click node_timers "https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp"
click node_motionstate "https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_display,node_mouse,node_user toneBlue
class node_city,node_buildings,node_roads,node_weather,node_traffic toneAmber
class node_timers,node_motionstate toneMint
class node_glut,node_opengl toneIndigo
```

## Components

### Application runtime

- [Window setup](https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp): `A Reguler City Life 6/A Reguler City Life 6/main.cpp`
- [Scene display](https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp): `A Reguler City Life 6/A Reguler City Life 6/main.cpp`
- [Mouse handler](https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp): `A Reguler City Life 6/A Reguler City Life 6/main.cpp`

### City scene

- [City backdrop](https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp): `A Reguler City Life 6/A Reguler City Life 6/main.cpp`
- [Buildings](https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp): `A Reguler City Life 6/A Reguler City Life 6/main.cpp`
- [Roads](https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp): `A Reguler City Life 6/A Reguler City Life 6/main.cpp`
- [Weather and sky](https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp): `A Reguler City Life 6/A Reguler City Life 6/main.cpp`
- [Vehicles and train](https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp): `A Reguler City Life 6/A Reguler City Life 6/main.cpp`

### Animation

- [Timer callbacks](https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp): `A Reguler City Life 6/A Reguler City Life 6/main.cpp`
- [Animation state](https://github.com/sriman-dhar/computer-graphics-project-city-life/blob/main/A%20Reguler%20City%20Life%206/A%20Reguler%20City%20Life%206/main.cpp): `A Reguler City Life 6/A Reguler City Life 6/main.cpp`

### Other components

- **User**
- **GLUT**
- **OpenGL**

## Connections

- User → GLUT: interacts with
- Window setup → GLUT: initializes window
- Window setup → Scene display: registers display
- Window setup → Mouse handler: registers mouse
- Window setup → Timer callbacks: registers timers
- GLUT → Scene display: invokes display
- GLUT → Mouse handler: dispatches input
- Timer callbacks → Animation state: updates state
- Scene display → City backdrop: draws scene
- Scene display → Buildings: draws buildings
- Scene display → Roads: draws roads
- Scene display → Weather and sky: draws weather
- Scene display → Vehicles and train: draws traffic
- Scene display → OpenGL: issues draw calls
