Commit Graph

10 Commits

Author SHA1 Message Date
5127dd5bf2 Migration Gitea 2025-12-04 20:15:53 +08:00
21590418f1 feat: Add InputModule Phase 1 + IT_015 integration tests
Complete implementation of InputModule with SDL2 backend for mouse and keyboard input, plus UIModule integration tests.

## InputModule Features
- Mouse input capture (position, buttons, wheel)
- Keyboard input capture (keys, modifiers)
- SDL2 backend implementation
- IIO topic publishing (input🐭*, input⌨️*)
- Hot-reload compatible module structure

## Integration Tests (IT_015)
- IT_015_input_ui_integration: Full UIModule + IIO input test
- IT_015_minimal: Minimal IIO-only message publishing test
- Visual test_30: InputModule interactive showcase

## Known Issues
- Tests compile successfully but cannot run due to MinGW/Windows runtime DLL initialization error (0xC0000139)
- Workaround: Use VSCode debugger or native Windows execution
- See tests/integration/IT_015_STATUS.md for details

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 17:17:37 +08:00
579cadeae8 feat: Complete UIModule Phase 7 - ScrollPanel & Tooltips
This commit implements Phase 7 of the UIModule, adding advanced features
that make the UI system production-ready.

## Phase 7.1 - UIScrollPanel

New scrollable container widget with:
- Vertical and horizontal scrolling (configurable)
- Mouse wheel support with smooth scrolling
- Drag-to-scroll functionality (drag content or scrollbar)
- Interactive scrollbar with proportional thumb
- Automatic content size calculation
- Visibility culling for performance
- Full styling support (colors, borders, scrollbar)

Files added:
- modules/UIModule/Widgets/UIScrollPanel.h
- modules/UIModule/Widgets/UIScrollPanel.cpp
- modules/UIModule/Core/UIContext.h (added mouseWheelDelta)
- modules/UIModule/UIModule.cpp (mouse wheel event routing)

## Phase 7.2 - Tooltips

Smart tooltip system with:
- Hover delay (500ms default)
- Automatic positioning with edge avoidance
- Semi-transparent background with border
- Per-widget tooltip text via JSON
- Tooltip property on all UIWidget types
- Renders on top of all UI elements

Files added:
- modules/UIModule/Core/UITooltip.h
- modules/UIModule/Core/UITooltip.cpp
- modules/UIModule/Core/UIWidget.h (added tooltip property)
- modules/UIModule/Core/UITree.cpp (tooltip parsing)

## Tests

Added comprehensive visual tests:
- test_28_ui_scroll.cpp - ScrollPanel with 35+ items
- test_29_ui_advanced.cpp - Tooltips on various widgets
- assets/ui/test_scroll.json - ScrollPanel layout
- assets/ui/test_tooltips.json - Tooltips layout

## Documentation

- docs/UI_MODULE_PHASE7_COMPLETE.md - Complete Phase 7 docs
- docs/PROMPT_UI_MODULE_PHASE6.md - Phase 6 & 7 prompt
- Updated CMakeLists.txt for new files and tests

## UIModule Status

UIModule is now feature-complete with:
 9 widget types (Panel, Label, Button, Image, Slider, Checkbox,
   ProgressBar, TextInput, ScrollPanel)
 Flexible layout system (vertical, horizontal, stack, absolute)
 Theme and style system
 Complete event system
 Tooltips with smart positioning
 Hot-reload support
 Comprehensive tests (Phases 1-7)

🚀 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 07:13:13 +08:00
9618a647a2 feat(BgfxRenderer): Fix multi-texture batching and add particle effects
- Fix texture state management in BgfxDevice: defer setTexture until submit()
- Add transient instance buffer support for multi-batch rendering
- Add ParticlePass with fire, smoke and sparkle particle systems
- Load multiple textures from config (texture1..texture10)
- Visual test now demonstrates multi-texture sprites and multi-particle effects

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 17:15:45 +08:00
613283d75c feat(BgfxRenderer): Phase 7-8 - Text, Tilemap, Multi-texture, Resize
Phase 7 - Text Rendering:
- Add BitmapFont with embedded 8x8 CP437 font (ASCII 32-126)
- Add TextPass for instanced glyph rendering
- Fix SceneCollector::parseText() to copy strings to FrameAllocator

Phase 8A - Multi-texture Support:
- Add numeric texture ID system in ResourceCache
- SpritePass sorts by textureId and batches per texture
- Flush batch on texture change for efficient rendering

Phase 8B - Tilemap Rendering:
- Add TilemapPass for grid-based tile rendering
- Support tileData as comma-separated string
- Tiles rendered as instanced quads

Window Resize:
- Handle window resize via process() input
- Call bgfx::reset() on size change

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 22:09:48 +08:00
4932017244 feat(BgfxRenderer): Add debug overlay with FPS and stats display
- Create DebugOverlay class using bgfx debug text API
- Display FPS (color-coded: green >55, yellow >30, red <30)
- Show frame time, sprite count, draw calls
- Show GPU/CPU timing and texture stats from bgfx
- Add "debugOverlay" config option to enable at startup
- Smooth FPS display over 250ms intervals

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 21:23:29 +08:00
2f8e78b247 feat(BgfxRenderer): Phase 6 - Texture loading with stb_image
- Add TextureLoader class using stb_image for PNG/JPG/etc loading
- Integrate TextureLoader with ResourceCache for cached texture loading
- Add SpritePass::setTexture() for binding textures to sprites
- Add "defaultTexture" config option to load texture at startup
- Create assets/textures folder structure
- Add 1f440.png (eyes emoji) test texture

Visual test confirms textured sprites render correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 19:44:13 +08:00
10a9ac76c3 feat(BgfxRenderer): Phase 5 - Visual sprite test with IIO pipeline
- Add test_23_bgfx_sprites_visual.cpp: full visual test with SDL2 + IIO
- Fix IRHIDevice::init() to accept nativeDisplayHandle for X11/Linux
- Fix BgfxDevice::createBuffer() with proper VertexLayout for dynamic buffers
- Use double for native handle config values (preserves 64-bit pointers)
- Add debug logging in BgfxRendererModule initialization

Pipeline verified working:
- Module loads and initializes with Vulkan
- IIO messages routed correctly (sprites, camera, clear)
- SceneCollector collects and builds FramePacket
- RenderGraph executes passes
- ~500 FPS throughput

Note: Sprites not visually rendered yet (shader needs instancing support)
This will be addressed in a future phase.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 13:37:23 +08:00
4a30b1f149 feat(BgfxRenderer): Complete Phase 4 - ShaderManager integration
- Refactor ShaderManager to use RHI abstraction (no bgfx:: exposed)
- Implement Option E: inject ShaderHandle via pass constructors
- SpritePass/DebugPass now receive shader in constructor
- RenderPass::execute() takes IRHIDevice& for dynamic buffer updates
- SpritePass::execute() updates instance buffer from FramePacket
- Integrate ShaderManager lifecycle in BgfxRendererModule
- Add test_22_bgfx_sprites.cpp (visual test with SDL2)
- Add test_22_bgfx_sprites_headless.cpp (headless data structure test)
- Update PLAN_BGFX_RENDERER.md with Phase 4 completion and Phase 6.5

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 22:27:19 +08:00
1443c1209e feat(BgfxRenderer): Complete Phase 2-3 with shaders and triangle rendering
Phase 2 - RHI Layer:
- Fix Command struct default constructor for union with non-trivial types
- Add missing mutex includes in ResourceCache.cpp
- Fix const_cast for getChildReadOnly in SceneCollector

Phase 3 - Shaders & Visual Test:
- Add ShaderManager for centralized shader loading
- Embed pre-compiled shaders (OpenGL, Vulkan, DX11, Metal)
- Add test_20_bgfx_rhi: 23 unit tests for RHI components
- Add test_21_bgfx_triangle: visual test rendering colored triangle

Test results:
- RHI unit tests: 23/23 passing
- Visual test: ~567 FPS with Vulkan renderer

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 16:43:17 +08:00