Skip to content

Refactor flat screen display to use overlay system#9

Open
mutars wants to merge 1 commit intomasterfrom
claude/openvr-overlay-support-SV2yb
Open

Refactor flat screen display to use overlay system#9
mutars wants to merge 1 commit intomasterfrom
claude/openvr-overlay-support-SV2yb

Conversation

@mutars
Copy link
Owner

@mutars mutars commented Feb 5, 2026

Summary

Refactored the flat screen display feature to leverage the existing overlay system instead of using a separate quad layer configuration. This consolidates UI rendering logic and provides better integration with the overlay component's positioning and interaction handling.

Key Changes

  • Removed flat screen distance slider from VR settings UI and configuration system

    • Deleted m_flat_screen_distance member variable and its associated ModSlider
    • Removed the setting from ModSettings::showFlatScreenDisplay() logic that was specific to OpenVR
  • Integrated flat screen display with overlay component

    • Re-enabled update_slate_openvr() to handle OpenVR flat screen rendering
    • Implemented generate_slate_quad() for OpenXR flat screen rendering
    • Both now respect ModSettings::showFlatScreenDisplay() to conditionally show/hide the overlay
  • Reorganized overlay UI settings

    • Grouped flat screen display settings under a collapsible "Flat Screen Display" section (only shown when enabled)
    • Grouped framework UI settings under a separate "Framework UI" section
    • Simplified setting labels (e.g., "Distance" instead of "Framework Distance")
  • Updated D3D11 and D3D12 components

    • Added slate quad layer generation in on_frame() methods when flat screen display is enabled
    • Integrated with the quad_layers composition system
  • Simplified OpenXR flat screen handling

    • Removed inline quad layer creation from OpenXR::end_frame()
    • Now delegates to OverlayComponent::generate_slate_quad() for consistent behavior

Implementation Details

The flat screen display now uses the same overlay positioning system as other UI elements, allowing users to control distance, size, and offset through the unified overlay settings. Controller intersection detection is properly implemented for both OpenVR and OpenXR backends.

https://claude.ai/code/session_01Ae7bwDrEvmhydD5MPCRKin

Move all overlay quad generation logic into OverlayComponent so both
OpenXR and OpenVR runtimes use a single code path for flat screen display.

- Add generate_slate_quad() to OverlayComponent::OpenXR for flat screen
  game display, replacing the inline quad code in OpenXR::end_frame()
- Add update_slate_openvr() for OpenVR flat screen overlay support using
  the existing m_slate_overlay_handle
- Wire D3D11/D3D12 components to pass slate quad layers from OverlayComponent
- Remove OpenVR early-return from showFlatScreenDisplay() to enable support
- Remove m_flat_screen_distance from VRRuntime and VR module (now owned by
  OverlayComponent's m_slate_distance with full UI controls)
- Restore slate overlay UI controls (distance, size, XY offset, follows view)
  and re-enable wrist UI option for OpenVR

https://claude.ai/code/session_01Ae7bwDrEvmhydD5MPCRKin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants