# davideberly/geometrictools architecture

> Architecture diagram of the GitHub repository davideberly/geometrictools, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/davideberly/geometrictools
- Repository: https://github.com/davideberly/geometrictools

## Overview

GTE is a C++ engine and library collection for mathematics, geometry, graphics, image analysis, and physics, with CPU and GPU computation. A typical user workflow is to call its mathematics and geometry algorithms, then build graphics resources and effects and use a platform-specific graphics/application wrapper to display or compute results. The graph also preserves the documented GPU-mathematics capability and the substantial project-generation utility. Source excerpts show graphics-engine responsibilities; broader subsystem relationships rely on the README, not inspection of every implementation.

Main entry points: [`GTE/Graphics/GraphicsEngine.cpp`](https://github.com/davideberly/geometrictools/blob/master/GTE/Graphics/GraphicsEngine.cpp) (Graphics Core), [`GTE/Applications/Application.cpp`](https://github.com/davideberly/geometrictools/blob/master/GTE/Applications/Application.cpp) (Application Framework), [`GTE/Tools/GenerateProject/GenerateProject.cpp`](https://github.com/davideberly/geometrictools/blob/master/GTE/Tools/GenerateProject/GenerateProject.cpp) (Project Generator), [`GTE/Graphics/VisualEffect.cpp`](https://github.com/davideberly/geometrictools/blob/master/GTE/Graphics/VisualEffect.cpp) (Effects)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_math["Mathematics"]
  node_mathlib["Math Algorithms"]
  node_geometry["Geometry Queries"]
end

subgraph group_gpu["GPU Computing"]
  node_gpu_math["GPU Mathematics"]
end

subgraph group_graphics["Graphics Engine"]
  node_graphics_core["Graphics Core<br/>[GraphicsEngine.cpp]"]
  node_render_objects["Render Resources<br/>[GraphicsObject.cpp]"]
  node_effects["Effects<br/>[VisualEffect.cpp]"]
  node_dx11["DirectX 11 Backend<br/>[DX11Engine.cpp]"]
  node_gl46["OpenGL 4.6 Backend<br/>[GL46Engine.cpp]"]
  node_glx["GLX Context<br/>[GLXEngine.cpp]"]
end

subgraph group_apps["Applications"]
  node_app_core["Application Framework<br/>[Application.cpp]"]
  node_windows["Window Systems"]
  node_platform_io["Platform File I/O"]
end

subgraph group_tools["Project Generator"]
  node_project_tool["Project Generator"]
  node_template_base["Template Base"]
  node_template_v17["VS 2022 Templates"]
  node_template_v18["VS 2026 Templates"]
  node_template_vscode["VS Code Templates"]
end

node_developer(("Library User"))

node_developer -->|"uses algorithms"| node_mathlib
node_developer -->|"uses engine"| node_graphics_core
node_developer -->|"uses GPU math"| node_gpu_math
node_mathlib -.->|"includes queries"| node_geometry
node_graphics_core -->|"manages resources"| node_render_objects
node_graphics_core -->|"draws effects"| node_effects
node_dx11 -->|"binds shaders"| node_effects
node_gl46 -->|"enables shaders"| node_effects
node_glx -->|"initializes engine"| node_gl46
node_developer -->|"uses framework"| node_app_core
node_app_core -.->|"supports windows"| node_windows
node_app_core -.->|"supports platform I/O"| node_platform_io
node_developer -.->|"generates projects"| node_project_tool
node_project_tool -->|"uses templates"| node_template_base
node_template_v17 -->|"specializes"| node_template_base
node_template_v18 -->|"specializes"| node_template_base
node_template_vscode -.->|"provides templates"| node_project_tool

click node_mathlib "https://github.com/davideberly/geometrictools/tree/master/GTE/Mathematics"
click node_geometry "https://github.com/davideberly/geometrictools/tree/master/GTE/Mathematics"
click node_gpu_math "https://github.com/davideberly/geometrictools/tree/master/GTE/MathematicsGPU"
click node_graphics_core "https://github.com/davideberly/geometrictools/blob/master/GTE/Graphics/GraphicsEngine.cpp"
click node_render_objects "https://github.com/davideberly/geometrictools/blob/master/GTE/Graphics/GraphicsObject.cpp"
click node_effects "https://github.com/davideberly/geometrictools/blob/master/GTE/Graphics/VisualEffect.cpp"
click node_dx11 "https://github.com/davideberly/geometrictools/blob/master/GTE/Graphics/DX11/DX11Engine.cpp"
click node_gl46 "https://github.com/davideberly/geometrictools/blob/master/GTE/Graphics/GL46/GL46Engine.cpp"
click node_glx "https://github.com/davideberly/geometrictools/blob/master/GTE/Graphics/GL46/GLX/GLXEngine.cpp"
click node_app_core "https://github.com/davideberly/geometrictools/blob/master/GTE/Applications/Application.cpp"
click node_windows "https://github.com/davideberly/geometrictools/blob/master/GTE/Applications/WindowApplication.cpp"
click node_platform_io "https://github.com/davideberly/geometrictools/tree/master/GTE/Applications"
click node_project_tool "https://github.com/davideberly/geometrictools/blob/master/GTE/Tools/GenerateProject/GenerateProject.cpp"
click node_template_base "https://github.com/davideberly/geometrictools/blob/master/GTE/Tools/GenerateProject/ProjectTemplate.cpp"
click node_template_v17 "https://github.com/davideberly/geometrictools/blob/master/GTE/Tools/GenerateProject/ProjectTemplate.v17.cpp"
click node_template_v18 "https://github.com/davideberly/geometrictools/blob/master/GTE/Tools/GenerateProject/ProjectTemplate.v18.cpp"
click node_template_vscode "https://github.com/davideberly/geometrictools/blob/master/GTE/Tools/GenerateProject/ProjectTemplateVSCode.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_mathlib,node_geometry,node_developer toneBlue
class node_gpu_math toneAmber
class node_graphics_core,node_render_objects,node_effects,node_dx11,node_gl46,node_glx toneMint
class node_app_core,node_windows,node_platform_io toneRose
class node_project_tool,node_template_base,node_template_v17,node_template_v18,node_template_vscode toneIndigo
```

## Components

### Mathematics

- [Math Algorithms](https://github.com/davideberly/geometrictools/tree/master/GTE/Mathematics): `GTE/Mathematics`
- [Geometry Queries](https://github.com/davideberly/geometrictools/tree/master/GTE/Mathematics): `GTE/Mathematics`

### GPU Computing

- [GPU Mathematics](https://github.com/davideberly/geometrictools/tree/master/GTE/MathematicsGPU): `GTE/MathematicsGPU`

### Graphics Engine

- [Graphics Core](https://github.com/davideberly/geometrictools/blob/master/GTE/Graphics/GraphicsEngine.cpp): `GTE/Graphics/GraphicsEngine.cpp`
- [Render Resources](https://github.com/davideberly/geometrictools/blob/master/GTE/Graphics/GraphicsObject.cpp): `GTE/Graphics/GraphicsObject.cpp`
- [Effects](https://github.com/davideberly/geometrictools/blob/master/GTE/Graphics/VisualEffect.cpp): `GTE/Graphics/VisualEffect.cpp`
- [DirectX 11 Backend](https://github.com/davideberly/geometrictools/blob/master/GTE/Graphics/DX11/DX11Engine.cpp): `GTE/Graphics/DX11/DX11Engine.cpp`
- [OpenGL 4.6 Backend](https://github.com/davideberly/geometrictools/blob/master/GTE/Graphics/GL46/GL46Engine.cpp): `GTE/Graphics/GL46/GL46Engine.cpp`
- [GLX Context](https://github.com/davideberly/geometrictools/blob/master/GTE/Graphics/GL46/GLX/GLXEngine.cpp): `GTE/Graphics/GL46/GLX/GLXEngine.cpp`

### Applications

- [Application Framework](https://github.com/davideberly/geometrictools/blob/master/GTE/Applications/Application.cpp): `GTE/Applications/Application.cpp`
- [Window Systems](https://github.com/davideberly/geometrictools/blob/master/GTE/Applications/WindowApplication.cpp): `GTE/Applications/WindowApplication.cpp`
- [Platform File I/O](https://github.com/davideberly/geometrictools/tree/master/GTE/Applications): `GTE/Applications`

### Project Generator

- [Project Generator](https://github.com/davideberly/geometrictools/blob/master/GTE/Tools/GenerateProject/GenerateProject.cpp): `GTE/Tools/GenerateProject/GenerateProject.cpp`
- [Template Base](https://github.com/davideberly/geometrictools/blob/master/GTE/Tools/GenerateProject/ProjectTemplate.cpp): `GTE/Tools/GenerateProject/ProjectTemplate.cpp`
- [VS 2022 Templates](https://github.com/davideberly/geometrictools/blob/master/GTE/Tools/GenerateProject/ProjectTemplate.v17.cpp): `GTE/Tools/GenerateProject/ProjectTemplate.v17.cpp`
- [VS 2026 Templates](https://github.com/davideberly/geometrictools/blob/master/GTE/Tools/GenerateProject/ProjectTemplate.v18.cpp): `GTE/Tools/GenerateProject/ProjectTemplate.v18.cpp`
- [VS Code Templates](https://github.com/davideberly/geometrictools/blob/master/GTE/Tools/GenerateProject/ProjectTemplateVSCode.cpp): `GTE/Tools/GenerateProject/ProjectTemplateVSCode.cpp`

### Other components

- **Library User**

## Connections

- Library User → Math Algorithms: uses algorithms
- Library User → Graphics Core: uses engine
- Library User → GPU Mathematics: uses GPU math
- Math Algorithms → Geometry Queries: includes queries
- Graphics Core → Render Resources: manages resources
- Graphics Core → Effects: draws effects
- DirectX 11 Backend → Effects: binds shaders (evidence: `GTE/Graphics/DX11/DX11Engine.cpp`)
- OpenGL 4.6 Backend → Effects: enables shaders (evidence: `GTE/Graphics/GL46/GL46Engine.cpp`)
- GLX Context → OpenGL 4.6 Backend: initializes engine (evidence: `GTE/Graphics/GL46/GLX/GLXEngine.cpp`)
- Library User → Application Framework: uses framework
- Application Framework → Window Systems: supports windows
- Application Framework → Platform File I/O: supports platform I/O
- Library User → Project Generator: generates projects
- Project Generator → Template Base: uses templates
- VS 2022 Templates → Template Base: specializes (evidence: `GTE/Tools/GenerateProject/ProjectTemplate.v17.cpp`)
- VS 2026 Templates → Template Base: specializes (evidence: `GTE/Tools/GenerateProject/ProjectTemplate.v18.cpp`)
- VS Code Templates → Project Generator: provides templates
