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

feat: add window as third param to update #930

Closed

Conversation

TimUntersberger
Copy link
Contributor

@TimUntersberger TimUntersberger commented Jun 25, 2021

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.

  • winit => winit::window::Window
  • glutin => glutin::window::Window
  • web => ()

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

@hecrj hecrj added the feature New feature or request label Jul 21, 2021
@hecrj hecrj added this to the 0.4.0 milestone Jul 21, 2021
@hecrj hecrj closed this in #1019 Sep 13, 2021
@TimUntersberger TimUntersberger deleted the runtime-resize branch September 13, 2021 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
2 participants