Skip to content
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

Add a View resize notification function called from WindowResizeHandler #1335

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dov
Copy link

@dov dov commented Nov 26, 2024

  • This allows creating views that are redrawn on window resize

Pull Request Template

Description

Some View's may need updating when the window is resized. E.g. if doing a pixel exact 2D overlay, we may want to resize the elements to be of a certain size in pixels. I could not find any callback that I could catch in my custom view that notifies of such resizing. This was the reason that I introduced the resize() abstract callback.

Another issue with pixel exact overlays, is that we may want to have the projection matrix fixed. Currently, the projection matrix is updated in WindowResizeHandler::apply(vsg::View&). An overloaded resize() method allows resetting the projectionMatrix to an expected transparent state.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

I created a test program available here: https://gist.github.com/dov/b4ca06a0b13558b75da05948eb955777

Test Configuration:

Tested on Linux .

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

- This allows creating views that are redrawn on window resize
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.

1 participant