# elliahu/hammock architecture

> Architecture diagram of the GitHub repository elliahu/hammock, 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/elliahu/hammock
- Repository: https://github.com/elliahu/hammock

## Overview

Hammock is a cross-platform C++23/Vulkan game-engine library. Its primary workflow is an application using the engine to create a window and Vulkan device, load scene assets, prepare GPU resources and graphics pipelines, and render through the engine’s rendering context. The README also documents UI, deferred physically based rendering, volumetric clouds, texture types, and image-based lighting/environment-map generation. The sampled code directly supports resource creation and environment-map generation; several runtime subsystem links are based on the documented capabilities and module boundaries, since their implementations were not sampled.

Main entry points: [`src/hammock/core/DeviceStorage.cpp`](https://github.com/elliahu/hammock/blob/master/src/hammock/core/DeviceStorage.cpp) (Device storage), [`src/hammock/core/Device.cpp`](https://github.com/elliahu/hammock/blob/master/src/hammock/core/Device.cpp) (Vulkan device), [`tools/environment_maps_generator/main.cpp`](https://github.com/elliahu/hammock/blob/master/tools/environment_maps_generator/main.cpp) (Environment map tool), [`include/hammock/hammock.h`](https://github.com/elliahu/hammock/blob/master/include/hammock/hammock.h) (Engine API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Platform and Vulkan"]
  node_window["Window<br/>[Window.cpp]"]
  node_instance["Vulkan instance<br/>[VulkanInstance.cpp]"]
  node_device["Vulkan device<br/>[Device.cpp]"]
  node_swapchain["Swap chain<br/>[SwapChain.cpp]"]
end

subgraph group_scene["Scene and assets"]
  node_camera["Camera<br/>[Camera.cpp]"]
  node_geometry["Geometry<br/>[Geometry.cpp]"]
  node_asset["Asset delivery<br/>[AssetDelivery.cpp]"]
end

subgraph group_render["Rendering"]
  node_context["Render context<br/>[RenderContext.cpp]"]
  node_pipeline["Graphics pipeline"]
  node_raytracing["Ray tracing<br/>[Raytracing.cpp]"]
end

subgraph group_resources["GPU resources"]
  node_storage[("Device storage<br/>[DeviceStorage.cpp]")]
  node_buffer["Buffers<br/>[Buffer.cpp]"]
  node_descriptors["Descriptors<br/>[Descriptors.cpp]"]
  node_texture["Textures<br/>[Texture.cpp]"]
end

subgraph group_extras["UI and generation"]
  node_generator["Map generator<br/>[Generator.cpp]"]
  node_ui["UI system<br/>[UserInterface.cpp]"]
  node_imgui["ImGui Vulkan backend"]
  node_tool["Environment map tool<br/>[main.cpp]"]
end

node_app(("Application"))
node_api["Engine API<br/>[hammock.h]"]
node_vulkan["Vulkan"]

node_app -->|"uses"| node_api
node_api -->|"exposes"| node_window
node_api -->|"exposes"| node_device
node_window -->|"uses"| node_instance
node_device -->|"uses"| node_instance
node_device -->|"calls"| node_vulkan
node_swapchain -->|"calls"| node_vulkan
node_context -->|"records commands"| node_vulkan
node_pipeline -->|"creates pipeline"| node_vulkan
node_raytracing -->|"uses"| node_vulkan
node_asset -->|"delivers assets"| node_geometry
node_storage -->|"uses"| node_device
node_storage -->|"creates"| node_buffer
node_storage -->|"builds"| node_descriptors
node_storage -->|"creates"| node_texture
node_generator -->|"creates textures"| node_storage
node_generator -->|"renders with"| node_pipeline
node_ui -->|"renders through"| node_imgui
node_tool -->|"creates"| node_window
node_tool -->|"creates"| node_device
node_tool -->|"creates resources"| node_storage
node_tool -->|"generates maps"| node_generator

click node_api "https://github.com/elliahu/hammock/blob/master/include/hammock/hammock.h"
click node_window "https://github.com/elliahu/hammock/blob/master/src/hammock/platform/Window.cpp"
click node_instance "https://github.com/elliahu/hammock/blob/master/src/hammock/core/VulkanInstance.cpp"
click node_device "https://github.com/elliahu/hammock/blob/master/src/hammock/core/Device.cpp"
click node_swapchain "https://github.com/elliahu/hammock/blob/master/src/hammock/core/SwapChain.cpp"
click node_context "https://github.com/elliahu/hammock/blob/master/src/hammock/core/RenderContext.cpp"
click node_pipeline "https://github.com/elliahu/hammock/blob/master/src/hammock/core/GraphicsPipeline.cpp"
click node_raytracing "https://github.com/elliahu/hammock/blob/master/src/hammock/core/Raytracing.cpp"
click node_camera "https://github.com/elliahu/hammock/blob/master/src/hammock/scene/Camera.cpp"
click node_geometry "https://github.com/elliahu/hammock/blob/master/src/hammock/scene/Geometry.cpp"
click node_asset "https://github.com/elliahu/hammock/blob/master/src/hammock/scene/AssetDelivery.cpp"
click node_storage "https://github.com/elliahu/hammock/blob/master/src/hammock/core/DeviceStorage.cpp"
click node_buffer "https://github.com/elliahu/hammock/blob/master/src/hammock/resources/Buffer.cpp"
click node_descriptors "https://github.com/elliahu/hammock/blob/master/src/hammock/resources/Descriptors.cpp"
click node_texture "https://github.com/elliahu/hammock/blob/master/src/hammock/resources/Texture.cpp"
click node_generator "https://github.com/elliahu/hammock/blob/master/src/hammock/resources/Generator.cpp"
click node_ui "https://github.com/elliahu/hammock/blob/master/src/hammock/utils/UserInterface.cpp"
click node_imgui "https://github.com/elliahu/hammock/blob/master/external/imgui/backends/imgui_impl_vulkan.cpp"
click node_tool "https://github.com/elliahu/hammock/blob/master/tools/environment_maps_generator/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_window,node_instance,node_device,node_swapchain toneBlue
class node_camera,node_geometry,node_asset toneAmber
class node_context,node_pipeline,node_raytracing,node_api toneMint
class node_storage,node_buffer,node_descriptors,node_texture toneRose
class node_generator,node_ui,node_imgui,node_tool,node_app,node_vulkan toneIndigo
```

## Components

### Platform and Vulkan

- [Window](https://github.com/elliahu/hammock/blob/master/src/hammock/platform/Window.cpp): `src/hammock/platform/Window.cpp`
- [Vulkan instance](https://github.com/elliahu/hammock/blob/master/src/hammock/core/VulkanInstance.cpp): `src/hammock/core/VulkanInstance.cpp`
- [Vulkan device](https://github.com/elliahu/hammock/blob/master/src/hammock/core/Device.cpp): `src/hammock/core/Device.cpp`
- [Swap chain](https://github.com/elliahu/hammock/blob/master/src/hammock/core/SwapChain.cpp): `src/hammock/core/SwapChain.cpp`

### Scene and assets

- [Camera](https://github.com/elliahu/hammock/blob/master/src/hammock/scene/Camera.cpp): `src/hammock/scene/Camera.cpp`
- [Geometry](https://github.com/elliahu/hammock/blob/master/src/hammock/scene/Geometry.cpp): `src/hammock/scene/Geometry.cpp`
- [Asset delivery](https://github.com/elliahu/hammock/blob/master/src/hammock/scene/AssetDelivery.cpp): `src/hammock/scene/AssetDelivery.cpp`

### Rendering

- [Render context](https://github.com/elliahu/hammock/blob/master/src/hammock/core/RenderContext.cpp): `src/hammock/core/RenderContext.cpp`
- [Graphics pipeline](https://github.com/elliahu/hammock/blob/master/src/hammock/core/GraphicsPipeline.cpp): `src/hammock/core/GraphicsPipeline.cpp`
- [Ray tracing](https://github.com/elliahu/hammock/blob/master/src/hammock/core/Raytracing.cpp): `src/hammock/core/Raytracing.cpp`

### GPU resources

- [Device storage](https://github.com/elliahu/hammock/blob/master/src/hammock/core/DeviceStorage.cpp): `src/hammock/core/DeviceStorage.cpp`
- [Buffers](https://github.com/elliahu/hammock/blob/master/src/hammock/resources/Buffer.cpp): `src/hammock/resources/Buffer.cpp`
- [Descriptors](https://github.com/elliahu/hammock/blob/master/src/hammock/resources/Descriptors.cpp): `src/hammock/resources/Descriptors.cpp`
- [Textures](https://github.com/elliahu/hammock/blob/master/src/hammock/resources/Texture.cpp): `src/hammock/resources/Texture.cpp`

### UI and generation

- [Map generator](https://github.com/elliahu/hammock/blob/master/src/hammock/resources/Generator.cpp): `src/hammock/resources/Generator.cpp`
- [UI system](https://github.com/elliahu/hammock/blob/master/src/hammock/utils/UserInterface.cpp): `src/hammock/utils/UserInterface.cpp`
- [ImGui Vulkan backend](https://github.com/elliahu/hammock/blob/master/external/imgui/backends/imgui_impl_vulkan.cpp): `external/imgui/backends/imgui_impl_vulkan.cpp`
- [Environment map tool](https://github.com/elliahu/hammock/blob/master/tools/environment_maps_generator/main.cpp): `tools/environment_maps_generator/main.cpp`

### Other components

- **Application**
- [Engine API](https://github.com/elliahu/hammock/blob/master/include/hammock/hammock.h): `include/hammock/hammock.h`
- **Vulkan**

## Connections

- Application → Engine API: uses
- Engine API → Window: exposes
- Engine API → Vulkan device: exposes
- Window → Vulkan instance: uses
- Vulkan device → Vulkan instance: uses
- Vulkan device → Vulkan: calls
- Swap chain → Vulkan: calls
- Render context → Vulkan: records commands
- Graphics pipeline → Vulkan: creates pipeline
- Ray tracing → Vulkan: uses
- Asset delivery → Geometry: delivers assets
- Device storage → Vulkan device: uses
- Device storage → Buffers: creates
- Device storage → Descriptors: builds
- Device storage → Textures: creates
- Map generator → Device storage: creates textures
- Map generator → Graphics pipeline: renders with
- UI system → ImGui Vulkan backend: renders through
- Environment map tool → Window: creates
- Environment map tool → Vulkan device: creates
- Environment map tool → Device storage: creates resources
- Environment map tool → Map generator: generates maps
