-
Notifications
You must be signed in to change notification settings - Fork 20
Add API for setting custom window dimensions #622
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
base: main
Are you sure you want to change the base?
Conversation
This commit adds two new methods to the SciView class: - setWindowSize(width, height): Sets custom window dimensions, essential for VR headsets - getWindowSize(): Returns the current window dimensions The setWindowSize method properly updates the frame, renderer, and camera aspect ratio to ensure consistent rendering at the new resolution.
This commit adds an overloaded create(width, height) method that allows specifying initial window dimensions when creating a SciView instance. This provides a convenient way to initialize SciView with VR-specific resolutions right from the start.
This demo shows how to use the new setWindowSize API to set custom window dimensions. It includes visual markers to demonstrate the viewport aspect ratio after resizing.
This test verifies that the setWindowSize and getWindowSize methods work correctly.
Added documentation for the new setWindowSize and getWindowSize API methods, including usage examples and use cases.
Thanks a lot! @kephale
Same requirement for Reverting to 37 fixes it. Could be that it conflicts with the other repositories (scenery and manvr3d) next to sciview. |
In #616 you wrote that the CI was fixed by updating to |
@smlpt yeah, this wasn't really for review. I don't have a lot of bandwidth for this now (sciview isn't part of my day-to-day work anymore) so I just wanted to see what could be autocompleted. I'm happy to close this and review a PR if you want to submit. Otherwise I'm not sure when I'll be able to revisit this. |
@kephale I see. You could have told me that you don't have time to work on sciview right now, I would have understood. On a side note, |
This reverts commit 667837f.
@smlpt Sorry, circumstances changed. I expected to be available again by now. I can check/merge if you'd like. I'm not going to have time to do any proper testing for the next ~month. |
@kephale thanks! I'm just trying to figure out the remaining issue with inconsistent renderer sizes after a window resizing event now, then we can merge this. @skalarproduktraum is aware of the issue and we'll look into it today or next week. |
Summary
This PR addresses issue #616 by adding an API to set custom width/height for the sciview window. This functionality is essential for VR headsets that require specific resolutions.
Changes
New API Methods
setWindowSize(width: Int, height: Int): Boolean
- Sets custom window dimensionsgetWindowSize(): Pair<Int, Int>
- Returns current window dimensionscreate(width: Int, height: Int): SciView
- Factory method to create SciView with initial dimensionsImplementation Details
Additional Files
Testing
The implementation has been tested with:
Use Cases
This API is particularly useful for:
Example Usage
Closes #616