feat: implemented swap chain recreation #103#130
feat: implemented swap chain recreation #103#130jirislav wants to merge 1 commit intoEmbarkStudios:mainfrom
Conversation
|
Here's a fix for what you encountered in #103 (comment): diff --git a/examples/example-runner/src/main.rs b/examples/example-runner/src/main.rs
index 7ca6bc1..99f4858 100644
--- a/examples/example-runner/src/main.rs
+++ b/examples/example-runner/src/main.rs
@@ -200,8 +200,8 @@ pub struct ExampleBase {
}
impl ExampleBase {
- pub fn render_loop<T, F: Fn(&Self) + 'static>(
- self,
+ pub fn render_loop<T, F: Fn(&mut Self) + 'static>(
+ mut self,
events_loop: winit::event_loop::EventLoop<T>,
f: F,
) -> ! {
@@ -209,7 +209,7 @@ impl ExampleBase {
use winit::event_loop::*;
events_loop.run(move |event, _window_target, control_flow| match event {
Event::RedrawEventsCleared { .. } => {
- f(&self);
+ f(&mut self);
}
Event::WindowEvent { event, .. } => match event {
WindowEvent::KeyboardInput { input, .. } => { |
4ced217 to
9bfa4c2
Compare
thank you, I didn't think about the callback definition, that solves my problem :) And to my surprise, the rest of code actually handles the But I see there is another bug, when I drag the window border to apply a manual resize (or double click the window title), I get error
|
4664f76 to
33bb375
Compare
|
@jirislav Thank you for your PR! I think you need to rebase your changes with the latest main to get CI to pass. |
|
Also just a warning that if #109 merges first, this will presumably have lots of conflicts |
Thanks for the heads up. I think I'm going to wait for it to merge and then redo my work on wgpu sample 🙂 |
|
I believe this has been done by #299, but thanks for your work here! |
As requested in #103