From 0c8af1dc0f8f5be8f801e9c82985c1144999e30e Mon Sep 17 00:00:00 2001 From: portersky <24420859+portersky@users.noreply.github.com> Date: Tue, 5 May 2026 22:35:17 +0200 Subject: [PATCH] docs: update AGENTS.md to reflect current project structure - Update source layout with scenes/ directory and static libraries - Add static library documentation (cbt_opengl, cbt_scene, scenes_cube) - Remove stale references to nerv project - Update run command for Windows --- AGENTS.md | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 3241488..2611a33 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -15,21 +15,29 @@ ```sh cmake -S . -B build -GNinja ninja -C build - ./build/cuber + .\build\cuber.exe ``` ### Dependencies Dependencies are managed via custom `Find*.cmake` scripts in `deps/`. These scripts use `FetchContent` under the hood to download and build -libraries automatically. They are shared with the `nerv` project. +libraries automatically. To add a new dependency: -1. Copy the corresponding `Find.cmake` from `nerv/deps/` +1. Add the corresponding `Find.cmake` to `deps/` 2. Add `find_package( REQUIRED)` to `CMakeLists.txt` 3. Link with `::` in `target_link_libraries()` +### Static Libraries + +The project is split into static libraries: + +- **`cbt_opengl`** — OpenGL abstraction (context, buffer, texture, vao, shader, descriptor) +- **`cbt_scene`** — Base scene class +- **`scenes_cube`** — Cube scene implementation + ### CMake Module Path `deps/` is added to `CMAKE_MODULE_PATH` so `find_package()` resolves @@ -91,7 +99,9 @@ Example: cuber/ CMakeLists.txt # Build configuration cuber.cpp # Entry point - cbt/ # Project namespace + cbt/ # Project namespace (utilities) + scene.hpp # Base scene class + scene.cpp # Scene implementation opengl/ # OpenGL abstraction layer context.hpp # OpenGL context RAII wrapper context.cpp # Context implementation @@ -101,13 +111,19 @@ cuber/ texture.cpp # Texture implementation descriptor.hpp # Descriptor set (Vulkan-style binding) descriptor.cpp # Descriptor implementation + shader.hpp # Shader program + shader.cpp # Shader implementation + vao.hpp # Vertex array object + vao.cpp # VAO implementation + scenes/ # Application scenes + cube.hpp # Spinning cube scene + cube.cpp # Cube scene implementation deps/ # Custom Find*.cmake scripts Findfmt.cmake # fmt library ``` ## Platform Support -The `nerv` project supports Windows, Linux, Emscripten, and Android via -`Platform.cmake` and `Flags.cmake`. These can be added to `cuber/deps/` -when cross-platform support is needed. +The project supports Windows, Linux, Emscripten, and Android via +`Platform.cmake` and `Flags.cmake` in `deps/`.