Project Structure
Core Library
The Core target is a static library containing the engine's runtime:
- Engine: Creates the GLFW window, requests OpenGL 3.3 Core Profile, loads GL functions via glad, owns all subsystems (renderer, physics, audio, native scripting), and runs the game loop
- Renderer: Gathers lights per frame, updates skeletal animations, precomputes normal matrices on the CPU, and renders entities with the default Blinn-Phong shader
- Shader: Loads, compiles, and links vertex and fragment shaders (GLSL 330 core) with a uniform location cache for performance
- Model: Loads glTF/GLB files via tinygltf, creates VAOs with vertex attribute pointers (including bone joints/weights), uploads mesh data to VBOs, and renders with shader-based materials and textures
- Animation: Samples skeletal animation clips and outputs bone matrices for GPU skinning
- Components:
Transform,ModelRenderer,Animator,Camera,PointLight,DirectionalLight,SpotLightstructs used as ECS components - EventBus: Typed publish/subscribe system for cross-cutting events (single-thread only by design)
- Input: Keyboard and mouse state tracking with press/release detection, action mapping, and context stacking
- Camera:
EditorCamerautility class with fly mode (RMB+WASD), orbit (Alt+LMB), pan (MMB), and focus-on-target - AssetManager: Template-based asset cache that deduplicates loaded resources via shared pointers
- Scene: JSON-based scene serialization with component serializer registry, file save/load, and play mode snapshot/restore with JSON validation
- PhysicsWorld: Wraps Jolt Physics v5.2.0 for rigid body simulation with fixed-timestep accumulator, automatic body creation via Flecs observers, collider bounds validation, and Transform synchronization
- AudioEngine: Wraps miniaudio for cross-platform audio playback with spatial sound support, using
std::unique_ptrfor sound lifetime management - Behavior System: Native C++ behavior framework with BehaviorRegistry for registering gameplay behaviors, NativeScript component for per-entity attachment
- ParticleSystem: CPU-based particle simulation with GPU point-sprite rendering, configurable emission rate, lifetime, color gradients, and gravity
- ProceduralMesh: Generates built-in 3D primitives (box, sphere, plane, cylinder, capsule) as Model instances
- DebugDraw: Immediate-mode debug line rendering for visualization of colliders and bounds
Editor Executable
The editor target links against Core and imgui to provide a visual editor:
- ProjectHub: Standalone project management window with card grid, project creation (with templates), deletion, and recent projects tracking
- EditorApp: Manages the docking layout, menu bar (File > New/Open/Save), keyboard shortcuts, play/stop mode with scene snapshots, and an unsaved-changes dialog on close
- Panels: Viewport (3D scene with EditorCamera), Scene Hierarchy (entity tree with add/delete), Inspector (component editing with Add Component menu), Asset Browser (file grid with drag-and-drop), Stats (FPS/frame graph), Console (filtered log output capped at 1000 entries)
- ComponentDrawers: ImGui-based property editors for all engine component types