How anotherseeker/comp3320-undergrad-group-project works
Sunken Castle is a small 3D engine with a C ABI and a Luau scripting host. A client initializes the engine, loads mesh and shader assets, creates scene objects, and runs the render loop; input and frame events can be forwarded to client callbacks or Luau. Rendering collects scene entities into draw commands and uses camera and object transforms to draw meshes with shaders. The sampled source supports the main engine flow; runtime internals and several engine modules were not sampled, so their wiring is shown only where evidenced by the tree or explicit calls.
Main entry points: sunken_engine.cpp C API facade · app.cpp App loop · asset_manager.cpp Asset manager · runtime.rs Luau runtime
Components 18
Engine API
- C API facade
engine/sunken_engine.cpp
Engine Core
- App loop
engine/core/app.cpp - Event manager
engine/core/events/events.cpp - Scene graph
engine/core/scene_graph.cpp - Asset manager
engine/core/asset_manager.cpp - Debugger
engine/core/debugger.cpp
Rendering
Luau Runtime
- Rust host
runtime/src/main.rs - Luau runtime
runtime/src/runtime.rs - Engine bindings
runtime/src/bindings.rs - User objects
runtime/src/ud_object.rs
Other components
- C++ client
- Luau script
runtime/demo_scripts/demo.luau - Mesh and shader files
assets - GLFW
- OpenGL
Connections 21
- C++ client → C API facade: calls API
- C API facade → App loop: initializes, runs
- C API facade → Event manager: registers listeners
- C API facade → Asset manager: loads, retrieves
- C API facade → Scene graph: creates, moves
- C API facade → Renderer: sets view
- App loop → GLFW: polls events
- App loop → Event manager: dispatches events
- Event manager → C API facade: calls callback
- App loop → Scene graph: submits entities
- Scene graph → Renderer: submits draws
- Renderer → OpenGL: issues draw calls
- Asset manager → Mesh and shader files: reads assets
- Asset manager → Mesh: builds meshes
- Asset manager → Shader: creates shaders
- Rust host → Luau runtime: runs script
- Luau runtime → Luau script: loads
- Rust host → Engine bindings: uses bindings
- Engine bindings → C API facade: calls exported API
- C API facade → Rust host: forwards events
- Luau runtime → User objects: uses objects