From 19b656891a804cc248ff46e2eff064b10f9f7b35 Mon Sep 17 00:00:00 2001 From: Joshua Rowe <17525998+omnisci3nce@users.noreply.github.com> Date: Sun, 12 May 2024 19:17:36 +1000 Subject: Create mkdocs.yaml --- .github/workflows/mkdocs.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/mkdocs.yaml diff --git a/.github/workflows/mkdocs.yaml b/.github/workflows/mkdocs.yaml new file mode 100644 index 0000000..91cb81d --- /dev/null +++ b/.github/workflows/mkdocs.yaml @@ -0,0 +1,29 @@ +name: ci +on: + push: + branches: + - master + - main +permissions: + contents: write +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - uses: actions/cache@v4 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + - run: pip install mkdocs-material + - run: mkdocs gh-deploy --force -- cgit v1.2.3-70-g09d2 From 50034c05071e1e1701a1e336d3415313acd051e8 Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sun, 12 May 2024 19:19:27 +1000 Subject: mkdocs.yaml --- .github/workflows/documentation.yaml | 29 +++++++++++++++++++++++++++++ .github/workflows/mkdocs.yaml | 29 ----------------------------- mkdocs.yaml | 3 +++ 3 files changed, 32 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/documentation.yaml delete mode 100644 .github/workflows/mkdocs.yaml create mode 100644 mkdocs.yaml diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml new file mode 100644 index 0000000..91cb81d --- /dev/null +++ b/.github/workflows/documentation.yaml @@ -0,0 +1,29 @@ +name: ci +on: + push: + branches: + - master + - main +permissions: + contents: write +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - uses: actions/cache@v4 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + - run: pip install mkdocs-material + - run: mkdocs gh-deploy --force diff --git a/.github/workflows/mkdocs.yaml b/.github/workflows/mkdocs.yaml deleted file mode 100644 index 91cb81d..0000000 --- a/.github/workflows/mkdocs.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: ci -on: - push: - branches: - - master - - main -permissions: - contents: write -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Configure Git Credentials - run: | - git config user.name github-actions[bot] - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - - uses: actions/setup-python@v5 - with: - python-version: 3.x - - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV - - uses: actions/cache@v4 - with: - key: mkdocs-material-${{ env.cache_id }} - path: .cache - restore-keys: | - mkdocs-material- - - run: pip install mkdocs-material - - run: mkdocs gh-deploy --force diff --git a/mkdocs.yaml b/mkdocs.yaml new file mode 100644 index 0000000..b15a94b --- /dev/null +++ b/mkdocs.yaml @@ -0,0 +1,3 @@ +site_name: Celeritas Engine +theme: + name: material \ No newline at end of file -- cgit v1.2.3-70-g09d2 From b738432c3259fa6ddb6184e9608894618a3cb0ee Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sun, 12 May 2024 19:20:58 +1000 Subject: docs folder --- docs/index.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 docs/index.md diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..f889ee0 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,42 @@ +# Welcome to Celeritas + +Welcome to the Celeritas Game Engine's documentation! + +## What is it? + +Celeritas is a small 3D game engine written in OCaml **and** plain ol' C. + +The idea underlying celeritas is to have a small versatile "core" that can then be added to from other languages. +This means you could add gameplay systems in OCaml but rely on the celeritas core layer to do all the heavy lifting +when it comes to computation or rendering. + +**What does 'celeritas' mean?** + +Celerity is an English word meaning "alacrity" "swiftness". +Celeritas is the original Latin word for celerity that the English is derived from. + +## Feature Set + +_(as of Jan 2024)_ + +**Implemented** + +* OpenGL renderer backend! ((*need to port Metal renderer over*)) +* Basic Blinn-Phong lighting model (*need to port from old project*) +* Task queue for loading mesh and texture data into memory on background threads (*how do we want to do this with OCaml engine?*) + +**In-progress** + +* UI system + +**Roadmap going forwards** + +* Skeletal animation +* Terrain rendering + +## Getting started + +Check out these in order + + + \ No newline at end of file -- cgit v1.2.3-70-g09d2 From e248c07d4dc894a00d0be3b572fba80db700a91f Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sun, 12 May 2024 19:21:52 +1000 Subject: docker commands for mkdocs --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index db00078..87da707 100644 --- a/README.md +++ b/README.md @@ -20,4 +20,11 @@ All third-party dependencies are licensed under their own license. * `xmake format` * Lint (no change) `find src/ -iname *.h -o -iname *.c | xargs clang-format --style=file --dry-run --Werror` * Format (edit in place) `find src/ \( -iname "*.h" -o -iname "*.c" \) | xargs clang-format -i --style=file` - * `clang-format` must be installed! \ No newline at end of file + * `clang-format` must be installed! + +* Documentation + * serve mkdocs locally + * `docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material` + + * Build docs static site + * `docker run --rm -it -v ${PWD}:/docs squidfunk/mkdocs-material build` \ No newline at end of file -- cgit v1.2.3-70-g09d2 From d6d83264ff9446f19b8f611f8173812d783a20c2 Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sun, 12 May 2024 19:37:03 +1000 Subject: proc Actions --- docs/getting-started.md | 7 +++++++ docs/rendering.md | 1 + 2 files changed, 8 insertions(+) create mode 100644 docs/getting-started.md create mode 100644 docs/rendering.md diff --git a/docs/getting-started.md b/docs/getting-started.md new file mode 100644 index 0000000..0baf21c --- /dev/null +++ b/docs/getting-started.md @@ -0,0 +1,7 @@ +--- +title: Getting up and running +--- + +The main build tool we use is [xmake](https://xmake.io/#/getting_started) so installing that is the main prerequisite. + +Once that is installed you *should* be able to simply run `xmake build` in the top-level directory. \ No newline at end of file diff --git a/docs/rendering.md b/docs/rendering.md new file mode 100644 index 0000000..0081ac5 --- /dev/null +++ b/docs/rendering.md @@ -0,0 +1 @@ +# Rendering \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 02e84ee4d18e705e3362be1e327fdb6f1397a032 Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sun, 12 May 2024 20:07:17 +1000 Subject: expand docs --- docs/Contributing/c-coding-style.md | 13 +++++++++++++ docs/Contributing/naming.md | 29 +++++++++++++++++++++++++++++ docs/index.md | 24 ++++++++++++------------ docs/project-layout.md | 9 +++++++++ docs/rendering.md | 8 +++++++- 5 files changed, 70 insertions(+), 13 deletions(-) create mode 100644 docs/Contributing/c-coding-style.md create mode 100644 docs/Contributing/naming.md create mode 100644 docs/project-layout.md diff --git a/docs/Contributing/c-coding-style.md b/docs/Contributing/c-coding-style.md new file mode 100644 index 0000000..4e268cc --- /dev/null +++ b/docs/Contributing/c-coding-style.md @@ -0,0 +1,13 @@ +--- +title: C Coding Style +--- + +A lot of these should be forced onto you by `clang-format` and `clang-tidy` but for posterity here are +a few of the styles that we stick to. + +* **Pointer next to type** - we use `type* variable` in function signatures and variable declarations e.g. `mat4* model` + + +## Memory + +### Arena allocation diff --git a/docs/Contributing/naming.md b/docs/Contributing/naming.md new file mode 100644 index 0000000..518c22e --- /dev/null +++ b/docs/Contributing/naming.md @@ -0,0 +1,29 @@ +--- +title: Naming Conventions +--- + +#### 1. Prefer SOV function names + +Prefer SOV Subject Object Verb naming for functions. + +This makes it very easy to find the functions you want with autocomplete and maintain a consistent naming convention +throughout the codebase. + +e.g. + +* `renderer_frame_begin` +* `engine_tick_begin` +* `texture_data_load` + +--- + +#### 2. Long-running systems + +systems that run for the lifetime of the application or for a very long time should have: + +* `bool system_init(system_state* state)` a `init` function +* `void system_shutdown(system_state* state)` and a `shutdown` function + +--- + +#### 3. TODO \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index f889ee0..54d6383 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,11 +4,12 @@ Welcome to the Celeritas Game Engine's documentation! ## What is it? -Celeritas is a small 3D game engine written in OCaml **and** plain ol' C. +Celeritas is a small 3D game engine written in plain ol' C **and** OCaml. The idea underlying celeritas is to have a small versatile "core" that can then be added to from other languages. This means you could add gameplay systems in OCaml but rely on the celeritas core layer to do all the heavy lifting -when it comes to computation or rendering. +when it comes to computation or rendering. I will be providing ocaml bindings to the C API but implementing Lua bindings for example +would be fairly trivial. **What does 'celeritas' mean?** @@ -17,26 +18,25 @@ Celeritas is the original Latin word for celerity that the English is derived fr ## Feature Set -_(as of Jan 2024)_ +**Implemented (core)** -**Implemented** - -* OpenGL renderer backend! ((*need to port Metal renderer over*)) +* Vulkan & OpenGL renderer backends (*need to port Metal renderer over*) * Basic Blinn-Phong lighting model (*need to port from old project*) -* Task queue for loading mesh and texture data into memory on background threads (*how do we want to do this with OCaml engine?*) +* Task queue for loading mesh and texture data into memory on background threads **In-progress** -* UI system +* Skeletal animation **Roadmap going forwards** -* Skeletal animation +* Collision detection * Terrain rendering +* GPU-driven rendering ## Getting started -Check out these in order +Check these pages out - - \ No newline at end of file +* [Getting started](getting-started.md) +* [Project layout](project-layout.md) \ No newline at end of file diff --git a/docs/project-layout.md b/docs/project-layout.md new file mode 100644 index 0000000..74a84aa --- /dev/null +++ b/docs/project-layout.md @@ -0,0 +1,9 @@ +--- +title: Project Layout +--- + +``` +deps/ - third-party dependencies +docs/ - these docs you're reading now that get built with mkdocs +TODO: the rest... +``` \ No newline at end of file diff --git a/docs/rendering.md b/docs/rendering.md index 0081ac5..05da5fc 100644 --- a/docs/rendering.md +++ b/docs/rendering.md @@ -1 +1,7 @@ -# Rendering \ No newline at end of file +# Rendering + +Rendering is split into 3 'registers'. + +1. **RAL** (Render Abstraction Layer) - thin abstraction over graphics APIs +2. **render** - implements the default renderer and higher-level functions like `draw_scene` +3. **immediate** - immediate-mode drawing API for things like debug visualisation and UI \ No newline at end of file -- cgit v1.2.3-70-g09d2