-
Notifications
You must be signed in to change notification settings - Fork 3
feat(bar): add close button #398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…tton interactions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds close button functionality to the content bar, enabling users to remove content through visual button interactions. The implementation uses instanced rendering for multiple close buttons, integrates ray-based input processing, and refactors shader management.
Key Changes
- Added interactive close button with hover states and click detection using ray-distance calculations
- Integrated callback mechanism for content removal through
setOnCloseCallback - Refactored shader compilation to use a reusable
Shaderclass
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/examples/transmute_browser.cpp | Registers close callbacks and adds input processing loop for content interactions |
| src/examples/shader.hpp | New reusable Shader class replacing inline shader compilation code |
| src/examples/content.hpp | Added WindowContext reference and processInput method for input handling |
| src/examples/content.cpp | Stores window context and delegates input processing to bar component |
| src/examples/bar_component.hpp | Added button rendering infrastructure, close callback, and Shader integration |
| src/examples/bar_component.cpp | Implements button geometry, instanced rendering, ray-based input detection, and shader refactoring |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…t/add-bar-close-button
This pull request adds interactive close button functionality to the
BarComponent, improves input handling, and updates the content dragging logic to use accurate world-space calculations. The most significant changes include the addition of instanced rendering for close buttons, new input processing for button interactions, and improved drag behavior that takes camera perspective into account.BarComponent: Close Button Rendering and Interaction
bar_component.cppandbar_component.hpp. This includes the newcreateButtonGeometry,updateButtonInstanceBuffer, and related OpenGL resource management. [1] [2] [3] [4]Shader and Resource Management
Shaderclass instead of raw OpenGL program management, simplifying uniform setting and program lifecycle. [1] [2] [3]Content Dragging Improvements
Input Handling Integration
processInputmethods to bothContentandBarComponent, connecting content-level input processing to bar interactions and enabling close button functionality. [1] [2]General Codebase Updates
xr_renderer.hppand ensuredWindowContextis stored inContentfor improved access to rendering and input context. [1] [2] [3]