# harryhello/computer-graphic-course architecture

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

- Interactive diagram: https://gitdiagram.com/harryhello/computer-graphic-course
- Repository: https://github.com/harryhello/computer-graphic-course

## Overview

This is a computer-graphics coursework repository, not one unified application: numbered directories hold independent assignments. The user-facing workflow is to run a lesson or renderer exercise and observe a rendered image or window; the numbered projects cover OpenGL fundamentals, a software-renderer implementation, and a later rasterizer exercise. The README also identifies midterm and final-project materials, but their source trees are not present here, so they are not expanded. Some renderer links below are dashed because the available index shows module references, not runtime calls.

Main entry points: [`0000/src`](https://github.com/harryhello/computer-graphic-course/tree/main/0000/src) (OpenGL chapters), [`0001/src/TRRenderer.cpp`](https://github.com/harryhello/computer-graphic-course/blob/main/0001/src/TRRenderer.cpp) (Renderer), [`0001/src/main.cpp`](https://github.com/harryhello/computer-graphic-course/blob/main/0001/src/main.cpp) (Renderer demo), [`0002/src/TRRenderer.cpp`](https://github.com/harryhello/computer-graphic-course/blob/main/0002/src/TRRenderer.cpp) (Renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_opengl["OpenGL lessons"]
  node_window["Window setup<br/>[app.h]"]
  node_shader["Shader helper<br/>[shader.h]"]
  node_camera["Camera controls<br/>[camera.h]"]
  node_lessons["OpenGL chapters"]
  node_lesson07["Camera lesson<br/>[main.cpp]"]
end

subgraph group_renderer["TinyRenderer"]
  node_appwindow["SDL app<br/>[TRWindowsApp.cpp]"]
  node_render1["Renderer<br/>[TRRenderer.cpp]"]
  node_mesh1["Drawable mesh<br/>[TRDrawableMesh.cpp]"]
  node_frame1["Framebuffer<br/>[TRFrameBuffer.cpp]"]
  node_pipeline1["Shader pipeline"]
  node_entry1["Renderer demo<br/>[main.cpp]"]
  node_app2["SDL app<br/>[TRWindowsApp.cpp]"]
  node_render2["Renderer<br/>[TRRenderer.cpp]"]
  node_mesh2["Drawable mesh<br/>[TRDrawableMesh.cpp]"]
  node_frame2["Framebuffer<br/>[TRFrameBuffer.cpp]"]
  node_pipeline2["Shader pipeline"]
  node_entry2["Renderer demo<br/>[main.cpp]"]
end

subgraph group_raster["Rasterizer exercise"]
  node_rasterentry["Raster demo<br/>[main.cpp]"]
  node_rastercore["Triangle rasterizer<br/>[rasterizer.cpp]"]
  node_triangle["Triangle data<br/>[Triangle.cpp]"]
  node_png["PNG output<br/>[savePng.cpp]"]
end

node_learner(("Learner"))
node_result(("Rendered output"))

node_learner -.->|"runs chapter"| node_lessons
node_lessons -->|"opens window"| node_window
node_lessons -->|"uses helper"| node_shader
node_lessons -->|"uses controls"| node_camera
node_learner -.->|"runs exercise"| node_entry1
node_entry1 -.->|"uses app"| node_appwindow
node_entry1 -.->|"uses renderer"| node_render1
node_render1 -.->|"uses mesh"| node_mesh1
node_render1 -.->|"uses buffer"| node_frame1
node_render1 -.->|"uses pipeline"| node_pipeline1
node_learner -.->|"runs exercise"| node_entry2
node_entry2 -.->|"uses app"| node_app2
node_entry2 -.->|"uses renderer"| node_render2
node_render2 -.->|"uses mesh"| node_mesh2
node_render2 -.->|"uses buffer"| node_frame2
node_render2 -.->|"uses pipeline"| node_pipeline2
node_learner -.->|"runs exercise"| node_rasterentry
node_rasterentry -.->|"uses rasterizer"| node_rastercore
node_rastercore -.->|"uses triangle"| node_triangle
node_rasterentry -.->|"writes image"| node_png
node_entry1 -.->|"renders output"| node_result
node_entry2 -.->|"renders output"| node_result
node_rasterentry -.->|"writes output"| node_result

click node_window "https://github.com/harryhello/computer-graphic-course/blob/main/0000/src/common/app.h"
click node_shader "https://github.com/harryhello/computer-graphic-course/blob/main/0000/src/common/shader.h"
click node_camera "https://github.com/harryhello/computer-graphic-course/blob/main/0000/src/common/camera.h"
click node_lessons "https://github.com/harryhello/computer-graphic-course/tree/main/0000/src"
click node_lesson07 "https://github.com/harryhello/computer-graphic-course/blob/main/0000/src/07_camera/main.cpp"
click node_appwindow "https://github.com/harryhello/computer-graphic-course/blob/main/0001/src/TRWindowsApp.cpp"
click node_render1 "https://github.com/harryhello/computer-graphic-course/blob/main/0001/src/TRRenderer.cpp"
click node_mesh1 "https://github.com/harryhello/computer-graphic-course/blob/main/0001/src/TRDrawableMesh.cpp"
click node_frame1 "https://github.com/harryhello/computer-graphic-course/blob/main/0001/src/TRFrameBuffer.cpp"
click node_pipeline1 "https://github.com/harryhello/computer-graphic-course/blob/main/0001/src/TRShaderPipeline.cpp"
click node_entry1 "https://github.com/harryhello/computer-graphic-course/blob/main/0001/src/main.cpp"
click node_app2 "https://github.com/harryhello/computer-graphic-course/blob/main/0002/src/TRWindowsApp.cpp"
click node_render2 "https://github.com/harryhello/computer-graphic-course/blob/main/0002/src/TRRenderer.cpp"
click node_mesh2 "https://github.com/harryhello/computer-graphic-course/blob/main/0002/src/TRDrawableMesh.cpp"
click node_frame2 "https://github.com/harryhello/computer-graphic-course/blob/main/0002/src/TRFrameBuffer.cpp"
click node_pipeline2 "https://github.com/harryhello/computer-graphic-course/blob/main/0002/src/TRShaderPipeline.cpp"
click node_entry2 "https://github.com/harryhello/computer-graphic-course/blob/main/0002/src/main.cpp"
click node_rasterentry "https://github.com/harryhello/computer-graphic-course/blob/main/0002/improve/main.cpp"
click node_rastercore "https://github.com/harryhello/computer-graphic-course/blob/main/0002/improve/rasterizer.cpp"
click node_triangle "https://github.com/harryhello/computer-graphic-course/blob/main/0002/improve/Triangle.cpp"
click node_png "https://github.com/harryhello/computer-graphic-course/blob/main/0002/src/savePng.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_shader,node_camera,node_lessons,node_lesson07 toneBlue
class node_appwindow,node_render1,node_mesh1,node_frame1,node_pipeline1,node_entry1,node_app2,node_render2,node_mesh2,node_frame2,node_pipeline2,node_entry2 toneAmber
class node_rasterentry,node_rastercore,node_triangle,node_png toneMint
class node_learner,node_result toneIndigo
```

## Components

### OpenGL lessons

- [Window setup](https://github.com/harryhello/computer-graphic-course/blob/main/0000/src/common/app.h): `0000/src/common/app.h`
- [Shader helper](https://github.com/harryhello/computer-graphic-course/blob/main/0000/src/common/shader.h): `0000/src/common/shader.h`
- [Camera controls](https://github.com/harryhello/computer-graphic-course/blob/main/0000/src/common/camera.h): `0000/src/common/camera.h`
- [OpenGL chapters](https://github.com/harryhello/computer-graphic-course/tree/main/0000/src): `0000/src`
- [Camera lesson](https://github.com/harryhello/computer-graphic-course/blob/main/0000/src/07_camera/main.cpp): `0000/src/07_camera/main.cpp`

### TinyRenderer

- [SDL app](https://github.com/harryhello/computer-graphic-course/blob/main/0001/src/TRWindowsApp.cpp): `0001/src/TRWindowsApp.cpp`
- [Renderer](https://github.com/harryhello/computer-graphic-course/blob/main/0001/src/TRRenderer.cpp): `0001/src/TRRenderer.cpp`
- [Drawable mesh](https://github.com/harryhello/computer-graphic-course/blob/main/0001/src/TRDrawableMesh.cpp): `0001/src/TRDrawableMesh.cpp`
- [Framebuffer](https://github.com/harryhello/computer-graphic-course/blob/main/0001/src/TRFrameBuffer.cpp): `0001/src/TRFrameBuffer.cpp`
- [Shader pipeline](https://github.com/harryhello/computer-graphic-course/blob/main/0001/src/TRShaderPipeline.cpp): `0001/src/TRShaderPipeline.cpp`
- [Renderer demo](https://github.com/harryhello/computer-graphic-course/blob/main/0001/src/main.cpp): `0001/src/main.cpp`
- [SDL app](https://github.com/harryhello/computer-graphic-course/blob/main/0002/src/TRWindowsApp.cpp): `0002/src/TRWindowsApp.cpp`
- [Renderer](https://github.com/harryhello/computer-graphic-course/blob/main/0002/src/TRRenderer.cpp): `0002/src/TRRenderer.cpp`
- [Drawable mesh](https://github.com/harryhello/computer-graphic-course/blob/main/0002/src/TRDrawableMesh.cpp): `0002/src/TRDrawableMesh.cpp`
- [Framebuffer](https://github.com/harryhello/computer-graphic-course/blob/main/0002/src/TRFrameBuffer.cpp): `0002/src/TRFrameBuffer.cpp`
- [Shader pipeline](https://github.com/harryhello/computer-graphic-course/blob/main/0002/src/TRShaderPipeline.cpp): `0002/src/TRShaderPipeline.cpp`
- [Renderer demo](https://github.com/harryhello/computer-graphic-course/blob/main/0002/src/main.cpp): `0002/src/main.cpp`

### Rasterizer exercise

- [Raster demo](https://github.com/harryhello/computer-graphic-course/blob/main/0002/improve/main.cpp): `0002/improve/main.cpp`
- [Triangle rasterizer](https://github.com/harryhello/computer-graphic-course/blob/main/0002/improve/rasterizer.cpp): `0002/improve/rasterizer.cpp`
- [Triangle data](https://github.com/harryhello/computer-graphic-course/blob/main/0002/improve/Triangle.cpp): `0002/improve/Triangle.cpp`
- [PNG output](https://github.com/harryhello/computer-graphic-course/blob/main/0002/src/savePng.cpp): `0002/src/savePng.cpp`

### Other components

- **Learner**
- **Rendered output**

## Connections

- Learner → OpenGL chapters: runs chapter (evidence: `README.md`)
- OpenGL chapters → Window setup: opens window (evidence: `0000/src/07_camera/main.cpp`)
- OpenGL chapters → Shader helper: uses helper (evidence: `0000/src/07_camera/main.cpp`)
- OpenGL chapters → Camera controls: uses controls (evidence: `0000/src/07_camera/main.cpp`)
- Learner → Renderer demo: runs exercise (evidence: `README.md`)
- Renderer demo → SDL app: uses app
- Renderer demo → Renderer: uses renderer
- Renderer → Drawable mesh: uses mesh
- Renderer → Framebuffer: uses buffer
- Renderer → Shader pipeline: uses pipeline
- Learner → Renderer demo: runs exercise (evidence: `README.md`)
- Renderer demo → SDL app: uses app
- Renderer demo → Renderer: uses renderer
- Renderer → Drawable mesh: uses mesh
- Renderer → Framebuffer: uses buffer
- Renderer → Shader pipeline: uses pipeline
- Learner → Raster demo: runs exercise (evidence: `README.md`)
- Raster demo → Triangle rasterizer: uses rasterizer
- Triangle rasterizer → Triangle data: uses triangle
- Raster demo → PNG output: writes image
- Renderer demo → Rendered output: renders output
- Renderer demo → Rendered output: renders output
- Raster demo → Rendered output: writes output
