Skip to content

Commit e670f85

Browse files
committed
docs: expanded design document
1 parent 3477609 commit e670f85

File tree

8 files changed

+527
-417
lines changed

8 files changed

+527
-417
lines changed

docs/BUILD.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ In order to build the engine, you will need:
1414

1515
The rest of the dependencies, like assimp and glfw, are present in the
1616
source tree as git submodules under the `external/` directory. These
17-
will be automatically built by the build system if you want a static
18-
build.
17+
will be automatically built by the build system.
1918

2019
## Clone the repo
2120

22-
Clone the project from GitHub with `--recurse-submodules` to download
23-
the dependencies.
21+
Clone the project from GitHub, use `--recurse-submodules` to pull the
22+
dependencies.
2423

2524
```bash
2625
git clone --recurse-submodules -j8 https://github.com/San7o/Brenta-Engine.git

docs/DESIGN.md

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,67 @@
11
# Design
22

3+
I could tell you that the Brenta engine was perfectly designed, with a
4+
clear vision from its inception, with a beautiful and powerful API
5+
that makes programming truly enjoyable. Except the fact that it would
6+
be a lie. It does not mean that I don't find the current design and
7+
API beautiful and fun - I think Brenta is a powerful engine - but its
8+
development has been more iterative than meticulously designed. I
9+
rewrote huge parts of the engine many many times, to the point where I
10+
am not scared to do big refactoring anymore - that is just routine -
11+
and I know I am deemed to repeat this process again. But through these
12+
many refactoring, the API reached a point where all objects work well
13+
together and you can reason about them through what I call the
14+
"architecture" or "design" of the engine. This is what I aim to
15+
describe in this documents.
16+
317
Game engines are complex pieces of software. They provide an interface
418
to define logic, render graphics, and access system resources like
519
audio and input, as well as providing a cross-platform abstraction to
620
the developer.
721

8-
Here is an high-level overview of the main objects Brenta provides:
9-
10-
![brenta-picture](./brenta-picture.png)
11-
12-
I wanted to write my own game engine primarily out of fascination and
13-
curiosity to understand how these big systems are designed and
14-
implemented. I found out that writing a game engine has a lot in
15-
common with writing an operating system. You are working with audio,
16-
files, video, network and the GPU. A game engine is essentially a
17-
realtime system since you need to compute logic and render the frame
18-
in under 16ms to run at 60 FPS, hence you have to understand how the
19-
CPU and memory works in order to optimize it. Obviously game engines
20-
and an operating system diverge in many other ways, for example an
21-
operating system should manage virtualization and security, while a
22-
game engine has to manage game logic and physics. Still, I think the
23-
parallelism is clear: you need to interface and reason about many
24-
types of systems and devices, which makes this project interesting to
25-
me.
22+
![high-level-overview](./brenta-picture.png)
23+
24+
I wanted to write my own graphics engine primarily because I was
25+
curious to understand how these big systems are designed and
26+
implemented, and as a programming exercise / learning experience. The
27+
more I learned about graphics the more I became fascinated and
28+
interested in the topic.
29+
30+
When I began this project in july 2024 I was really confused with
31+
using OpenGL and C++, it took me a while to develop a decent mental
32+
model. I was at my second year of university and I did not have any
33+
major programming experience, but I pushed through it and hacked some
34+
things. I became obsessed with the project for the entire summer,
35+
which led to the release of Brenta v1.0.0. I did not fully understand
36+
what I was doing and its design is more of a hack (and the code
37+
clearly shows it). I moved on to other projects afterwards.
38+
39+
I picked up the project in December 2025, I was a more experienced
40+
developer and I took up the challenge again. Here I fully rewrote
41+
every part of the engine, introducing most of the core abstractions
42+
that the engine uses. I found out that writing a game engine has a lot
43+
of overlap with writing an operating system (which is another area I
44+
am really interested in). You are working with audio, files, video,
45+
network and the GPU. A game engine is essentially a realtime system
46+
since you need to compute logic and render the frame in under 16ms to
47+
run at 60 FPS, hence you have to understand how the CPU and memory
48+
works in order to optimize it.
2649

2750
![engine-and-os](./engine-and-os.png)
2851

52+
## Subsystems
2953

30-
Brenta engine is divided in subsystems, each one has different
31-
responsibilities and provides certain abstractions. The most important
32-
subsystems are the Rendering, which manages things like the scene and
33-
render commands, and the Entity Component System (ECS) which manages
34-
game logic.
54+
One of the first architectural decision I made was the introduction of
55+
the `Sybsystem`. Brenta engine is divided in subsystems, each one has
56+
different responsibilities and provides certain abstractions. The most
57+
important subsystems are the Rendering, which manages things like the
58+
scene and render commands, and the Entity Component System (ECS) which
59+
manages game logic.
3560

3661
![brenta-subsystems](./brenta-subsystems.png)
3762

63+
We will talk about various subsystems now.
64+
3865
## Renderer
3966

4067
The renderer provides a set of abstraction for working with geometry

0 commit comments

Comments
 (0)