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

Render tree doesn't update with window resize #189

Open
Arsakes opened this issue Mar 16, 2016 · 1 comment
Open

Render tree doesn't update with window resize #189

Arsakes opened this issue Mar 16, 2016 · 1 comment

Comments

@Arsakes
Copy link

Arsakes commented Mar 16, 2016

In case user switches between two render trees from A to B there is a possiblity that A tree won't display corrent image. It happens every time user changes window size when using B render tree - in such case A render tree doesn't get informed about change and when swtiching back to A the image is scaled.

What is the best way to update custom renderTree so it takes into account changes in window size?

@Arsakes Arsakes changed the title Custom render tree doesn't update with window resize Render tree doesn't update with window resize Mar 16, 2016
@csvurt
Copy link
Contributor

csvurt commented Mar 29, 2016

I think right now we don't resize the buffers individually. Internally if the canvas changes size we just rebuild the entire RenderTree from scratch, so that would be the easiest thing to do in your case too.

You'd have to be careful to avoid race conditions because the RenderInterface may not be updated with the new canvas size until the next frame is drawn after a resize. Best bet would be to store a flag like needsResize in both RenderTrees and then recreate A the next time you switch from B to A. B should be recreated automatically by XML3D so long as it was the active tree when the resize happened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants