Commit Graph

1 Commits

Author SHA1 Message Date
John McCardle 967ebcf478 feat(rendering): implement RenderTexture base infrastructure and UIFrame clipping (#6)
- Added RenderTexture support to UIDrawable base class
  - std::unique_ptr<sf::RenderTexture> for opt-in rendering
  - Dirty flag system for optimization
  - enableRenderTexture() and markDirty() methods

- Implemented clip_children property for UIFrame
  - Python-accessible boolean property
  - Automatic RenderTexture creation when enabled
  - Proper coordinate transformation for nested frames

- Updated UIFrame::render() for clipping support
  - Renders to RenderTexture when clip_children=true
  - Handles nested clipping correctly
  - Only re-renders when dirty flag is set

- Added comprehensive dirty flag propagation
  - All property setters mark frame as dirty
  - Size changes recreate RenderTexture
  - Animation system integration

- Created tests for clipping functionality
  - Basic clipping test with visual verification
  - Advanced nested clipping test
  - Dynamic resize handling test

This is Phase 1 of the RenderTexture overhaul, providing the foundation
for advanced rendering effects like blur, glow, and viewport rendering.
2025-07-06 16:13:12 -04:00