feat: add window as third param to update #930
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR tries to tackle a common problem where you want to modify the window at runtime.
My proposed solution is to add a third param to the update function of an application which is the "Window" of each platform.
I also add an example under examples/use_window which shows how you could resize/move the application at runtime.
One problem which I haven't fixed yet is that when resizing the window using winit for example the application only rerenders after some time and moving the window before this rerender happens causes a
Next Frame: Outdated
from the Compositor.I don't really know how to fix this, because I am not too familiar with the codebase, so I would like some guidance on this.
If we would have to manually recreate the swap chain after resizing the window for instant rerendering I'd suggest we should create a wrapper Window struct which does this automatically and just delegates too platform-specific Window implementations.
Closes #767, Closes #644, Closes #493