Safi Game Engine

A Bevy-inspired Entity Component System where C# owns the game logic (components, systems, queries) and C++ is the rendering backend (Vulkan, multi-entity draw calls).

Architecture

C# (Mono)                          C++ (Vulkan)
┌─────────────────────┐            ┌──────────────────────┐
│  World              │            │  VulkanRenderer      │
│   ├─ Entities       │            │   ├─ Meshes (GPU)    │
│   ├─ Components     │  P/Invoke  │   ├─ Entities        │
│   ├─ Systems ───────┼───────────>│   ├─ Lights (UBO)    │
│   └─ Queries        │            │   └─ Push Constants  │
│                     │            │      (per-entity     │
│                     │            │       model matrix)  │
└─────────────────────┘            └──────────────────────┘

The C# World tracks entities and their components. Systems run each frame, querying for entities with specific component combinations. The RenderSyncSystem and LightSyncSystem push data to the C++ renderer via NativeBridge.

What's Implemented

FeatureStatus
ECS (World, Entities, Components, Systems, Queries)Done
3D Mesh loading (glTF)Done
Multi-entity rendering (push constants)Done
Transform component (position, rotation, scale, matrix)Done
Orbit camera (keyboard + mouse look, ESC toggle)Done
Keyboard input (polling)Done
Mouse input (position, cursor lock)Done
Depth testing / back-face cullingDone
Multiple dynamic lights (directional/point/spot, max 8)Done
Delta time (native C++ via glfwGetTime)Done
macOS .app bundleDone
Mouse buttons + scroll wheelDone
Timers (countdown/interval)Done
Runtime spawn/despawn with cleanupDone
Parent-child entity hierarchyDone
First-person / third-person cameraDone
Procedural primitives (box, sphere, plane, cylinder, capsule)Done
Free camera (debug fly camera)Done
Debug overlay (FPS, delta time, entity count)Done
UI rendering pipeline (2D quads, alpha blending)Done
Text rendering (stb_truetype font atlas)Done
Textures & UV mapping (glTF base color textures)Done
Physics (Jolt Physics via joltc — rigid bodies, colliders)Done
Fixed timestep (1/60s accumulator for physics)Done

Next Steps