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
This commit is contained in:
2026-05-05 22:35:17 +02:00
parent b6adb7c23a
commit 0c8af1dc0f
+23 -7
View File
@@ -15,21 +15,29 @@
```sh ```sh
cmake -S . -B build -GNinja cmake -S . -B build -GNinja
ninja -C build ninja -C build
./build/cuber .\build\cuber.exe
``` ```
### Dependencies ### Dependencies
Dependencies are managed via custom `Find*.cmake` scripts in `deps/`. Dependencies are managed via custom `Find*.cmake` scripts in `deps/`.
These scripts use `FetchContent` under the hood to download and build 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: To add a new dependency:
1. Copy the corresponding `Find<name>.cmake` from `nerv/deps/` 1. Add the corresponding `Find<name>.cmake` to `deps/`
2. Add `find_package(<name> REQUIRED)` to `CMakeLists.txt` 2. Add `find_package(<name> REQUIRED)` to `CMakeLists.txt`
3. Link with `<name>::<name>` in `target_link_libraries()` 3. Link with `<name>::<name>` 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 ### CMake Module Path
`deps/` is added to `CMAKE_MODULE_PATH` so `find_package()` resolves `deps/` is added to `CMAKE_MODULE_PATH` so `find_package()` resolves
@@ -91,7 +99,9 @@ Example:
cuber/ cuber/
CMakeLists.txt # Build configuration CMakeLists.txt # Build configuration
cuber.cpp # Entry point cuber.cpp # Entry point
cbt/ # Project namespace cbt/ # Project namespace (utilities)
scene.hpp # Base scene class
scene.cpp # Scene implementation
opengl/ # OpenGL abstraction layer opengl/ # OpenGL abstraction layer
context.hpp # OpenGL context RAII wrapper context.hpp # OpenGL context RAII wrapper
context.cpp # Context implementation context.cpp # Context implementation
@@ -101,13 +111,19 @@ cuber/
texture.cpp # Texture implementation texture.cpp # Texture implementation
descriptor.hpp # Descriptor set (Vulkan-style binding) descriptor.hpp # Descriptor set (Vulkan-style binding)
descriptor.cpp # Descriptor implementation 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 deps/ # Custom Find*.cmake scripts
Findfmt.cmake # fmt library Findfmt.cmake # fmt library
``` ```
## Platform Support ## Platform Support
The `nerv` project supports Windows, Linux, Emscripten, and Android via The project supports Windows, Linux, Emscripten, and Android via
`Platform.cmake` and `Flags.cmake`. These can be added to `cuber/deps/` `Platform.cmake` and `Flags.cmake` in `deps/`.
when cross-platform support is needed.