- Add BGFX_CONFIG_MULTITHREADED=0 to fix TLS crash when bgfx runs from DLL - Add -include stdint.h for MinGW GCC 15+ compatibility with bgfx third-party code - Guard SDL2-dependent visual tests with if(SDL2_FOUND) - Clean up debug logging in BgfxDevice::frame() and BgfxRendererModule::process() - Re-enable all modules in test_full_stack_interactive.cpp - Add grove::fs namespace for cross-platform filesystem operations - Add InputModule C export for feedEvent across DLL boundary 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
11 KiB
11 KiB
GroveEngine - Features Overview
Complete feature list for GroveEngine v1.0
Core Engine Features
Hot-Reload System
- ✅ 0.4ms average reload time (validated, blazing fast)
- ✅ State preservation via
getState()/setState() - ✅ Perfect stability (100% success rate in stress tests)
- ✅ Module independence (each ModuleLoader manages ONE module)
- ✅ Cache bypass for reliable reload (temp file copy technique)
Module System
- ✅ IModule interface - Standard module contract
- ✅ Dynamic loading (.so/.dll via dlopen/LoadLibrary)
- ✅ Configuration hot-reload (no code rebuild needed)
- ✅ Health monitoring via
getHealthStatus() - ✅ Graceful shutdown with cleanup
Communication (IIO)
- ✅ Pub/Sub messaging with topic-based routing
- ✅ Wildcard patterns (e.g.,
render:*,input:mouse:*) - ✅ IntraIO - Same-process communication (production ready)
- ✅ Low-frequency subscriptions with batching
- ✅ O(k) topic matching via TopicTree (k = topic depth)
- ✅ Thread-safe message queues
Data Abstraction
- ✅ IDataNode interface - Hierarchical configuration/state
- ✅ JsonDataNode - JSON-backed implementation
- ✅ Typed accessors (getString, getInt, getDouble, getBool)
- ✅ Tree navigation (getChild, getChildNames)
- ✅ Pattern matching (getChildrenByNameMatch)
Testing & Validation
- ✅ 23+ tests (unit, integration, stress, chaos)
- ✅ ThreadSanitizer support (data race detection)
- ✅ Helgrind support (deadlock detection)
- ✅ CTest integration
- ✅ Benchmark suite (TopicTree, batching, E2E)
Available Modules
BgfxRenderer - 2D Rendering
Status: ✅ Phase 7-8 Complete (Production Ready)
Rendering Capabilities
- ✅ Sprite rendering with batching (10,000+ sprites/frame)
- ✅ Text rendering with bitmap fonts
- ✅ Tilemap rendering with chunking
- ✅ Particle effects
- ✅ Debug shapes (lines, rectangles)
- ✅ Layer-based Z-ordering (depth sorting)
- ✅ Multi-texture batching (reduces draw calls)
Backends
- ✅ Auto-detection (best backend for platform)
- ✅ DirectX 11 (Windows)
- ✅ DirectX 12 (Windows 10+)
- ✅ OpenGL (Windows, Linux, macOS)
- ✅ Vulkan (Windows, Linux)
- ✅ Metal (macOS, iOS)
- ✅ Noop (headless testing)
Architecture
- ✅ RHI abstraction (no bgfx dependencies outside BgfxDevice.cpp)
- ✅ RenderGraph with topological sort (Kahn's algorithm)
- ✅ CommandBuffer for deferred rendering
- ✅ FrameAllocator (lock-free, reset per frame)
- ✅ ResourceCache (textures, shaders)
IIO Topics Consumed
render:sprite- Single spriterender:sprite:batch- Sprite batch (optimized)render:text- Text renderingrender:tilemap- Tilemap chunksrender:particle- Particle instancesrender:camera- Camera transformrender:clear- Clear colorrender:debug:line- Debug linesrender:debug:rect- Debug rectangles
UIModule - User Interface
Status: ✅ Phase 7 Complete (Production Ready)
Widget Types (10 Total)
- ✅ UIButton - Clickable button with hover states
- ✅ UILabel - Static text display
- ✅ UIPanel - Container widget
- ✅ UICheckbox - Toggle checkbox
- ✅ UISlider - Value slider (horizontal/vertical)
- ✅ UITextInput - Text input field with cursor
- ✅ UIProgressBar - Progress indicator
- ✅ UIImage - Sprite/texture display
- ✅ UIScrollPanel - Scrollable container with scrollbar
- ✅ UITooltip - Hover tooltips
Features
- ✅ JSON-based layouts - Define UI in JSON files
- ✅ Hierarchical widget tree - Parent/child relationships
- ✅ Automatic input handling - Consumes InputModule events
- ✅ Layer management - UI renders on top (layer 1000+)
- ✅ Event publishing - Game logic subscribes to UI events
- ✅ UIRenderer - Publishes to BgfxRenderer via IIO
- ✅ Hot-reload support - State preservation
IIO Topics Consumed
input:mouse:move- Mouse movementinput:mouse:button- Mouse clicksinput:mouse:wheel- Mouse wheel (scrolling)input:keyboard:key- Key eventsinput:keyboard:text- Text input
IIO Topics Published
ui:click- Widget clickedui:action- Button action triggeredui:value_changed- Slider/checkbox/input value changedui:text_submitted- Text input submitted (Enter)ui:hover- Mouse entered/left widgetui:scroll- Scroll panel scrolledrender:sprite- UI rectangles/imagesrender:text- UI text
InputModule - Input Handling
Status: ✅ Phase 1 Complete (Production Ready)
Input Sources
- ✅ Mouse - Move, button (left/middle/right), wheel
- ✅ Keyboard - Key events with modifiers (shift, ctrl, alt)
- ✅ Text input - UTF-8 text for TextInput widgets
- 📋 Gamepad - Phase 2 (buttons, axes, vibration)
Backends
- ✅ SDL2 - Cross-platform (Windows, Linux, macOS)
- 🔧 Extensible - Easy to add GLFW, Win32, etc.
Features
- ✅ Thread-safe event buffering - Feed events from any thread
- ✅ Generic event format - Backend-agnostic InputEvent
- ✅ IIO publishing - Converts to IIO messages
- ✅ Hot-reload support - State preservation (mouse position, button states)
IIO Topics Published
input:mouse:move- {x, y}input:mouse:button- {button, pressed, x, y}input:mouse:wheel- {delta}input:keyboard:key- {scancode, pressed, repeat, shift, ctrl, alt}input:keyboard:text- {text}
Integration Examples
Complete Game Loop
// Modules communicate via IIO
InputModule → IIO → UIModule → IIO → GameLogic
↓
BgfxRenderer (renders everything)
Message Flow Example
- User clicks button
- SDL generates
SDL_MOUSEBUTTONDOWN - InputModule publishes
input:mouse:button - UIModule subscribes, detects click on UIButton
- UIModule publishes
ui:actionwith button's action - GameLogic subscribes, receives action
- GameLogic publishes
render:spritefor player - BgfxRenderer subscribes, renders player sprite
Full Application Stack
┌─────────────────────────────────────────────┐
│ Your Game Logic Module │
│ (Subscribes: ui:*, Publishes: render:*) │
└──────────────┬──────────────────────────────┘
│ IIO Topics
┌──────────────┼──────────────────────────────┐
│ ┌───────────▼─────────┐ ┌──────────────┐ │
│ │ UIModule │ │ InputModule │ │
│ │ (Widgets, Layout) │◄──┤ (SDL2) │ │
│ └─────────┬───────────┘ └──────────────┘ │
│ │ render:sprite, render:text │
│ ┌─────────▼────────────┐ │
│ │ BgfxRenderer │ │
│ │ (bgfx Multi-backend) │ │
│ └──────────────────────┘ │
└─────────────────────────────────────────────┘
Platform Support
| Platform | Core | BgfxRenderer | UIModule | InputModule |
|---|---|---|---|---|
| Windows | ✅ MinGW/MSVC | ✅ DX11/DX12/OpenGL/Vulkan | ✅ | ✅ SDL2 |
| Linux | ✅ GCC/Clang | ✅ OpenGL/Vulkan | ✅ | ✅ SDL2 |
| macOS | ✅ Clang | ✅ Metal/OpenGL | ✅ | ✅ SDL2 |
Performance Metrics
Hot-Reload
- Average: 0.4ms
- Best: 0.055ms
- Worst: 2ms (5-cycle test total)
- Classification: 🚀 BLAZING
Rendering (BgfxRenderer)
- Sprite batching: 10,000+ sprites/frame
- Draw call reduction: Multi-texture batching
- Frame time: < 16ms @ 60fps (typical)
IIO Communication
- Topic matching: O(k) where k = topic depth
- Message overhead: Minimal (lock-free queues)
- Throughput: 100,000+ messages/second (validated)
UI System
- Update time: < 1ms per frame
- Widget limit: 1000+ widgets tested
- Layout caching: Tree built once, not per frame
Build System
CMake Options
# Core only
cmake -B build
# With rendering
cmake -B build -DGROVE_BUILD_BGFX_RENDERER=ON
# With UI
cmake -B build -DGROVE_BUILD_UI_MODULE=ON
# With input
cmake -B build -DGROVE_BUILD_INPUT_MODULE=ON
# Everything
cmake -B build \
-DGROVE_BUILD_BGFX_RENDERER=ON \
-DGROVE_BUILD_UI_MODULE=ON \
-DGROVE_BUILD_INPUT_MODULE=ON
# Debugging tools
cmake -B build -DGROVE_ENABLE_TSAN=ON # ThreadSanitizer
cmake -B build -DGROVE_ENABLE_HELGRIND=ON # Helgrind
Dependencies
Core:
- C++17 compiler
- CMake 3.20+
- spdlog (logging)
- nlohmann/json (JSON parsing)
BgfxRenderer:
- bgfx (auto-downloaded via FetchContent)
InputModule:
- SDL2
UIModule:
- (No additional deps, uses BgfxRenderer + InputModule via IIO)
Roadmap
Core Engine
- ✅ Hot-reload system
- ✅ IModule interface
- ✅ IntraIO communication
- ✅ JsonDataNode
- 📋 LocalIO (same-machine IPC)
- 📋 NetworkIO (distributed)
- 📋 ThreadedModuleSystem
- 📋 MultithreadedModuleSystem
BgfxRenderer
- ✅ Sprites, text, tilemap, particles
- ✅ Multi-backend support
- 📋 Texture loading (stb_image)
- 📋 Shader compilation (runtime)
- 📋 Multi-view support
- 📋 Render targets / post-processing
UIModule
- ✅ 10 widget types
- ✅ Layout system
- ✅ Scrolling + tooltips
- 📋 Drag-and-drop
- 📋 Animations
- 📋 Custom themes
InputModule
- ✅ Mouse + keyboard (SDL2)
- 📋 Gamepad support (Phase 2)
- 📋 Touch input (mobile)
- 📋 GLFW backend
- 📋 Win32 backend
Documentation
For Developers:
- DEVELOPER_GUIDE.md - 📘 Complete guide with examples
- USER_GUIDE.md - Module system basics
Module Docs:
Architecture:
GroveEngine - Build modular, hot-reloadable games with blazing-fast iteration 🌳🚀