-
Hello, I'm quite new to Rust, but I have extensive experience with C/C++. I'm wanting to use your WINIT crate to build out a Vulkan Renderer. I'm currently following Kyle Mayes's Vulkanalia Guide which utilizes the |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
I have the same problem with
I made changes for winit 0.30 which doesn't work. I even tried
Guys, help please to solve this puzzle. |
Beta Was this translation helpful? Give feedback.
-
Actually, I found out how to solve async part with
|
Beta Was this translation helpful? Give feedback.
-
One resolution is ※I am not familiar with this library and wgpu so I am sure there is a better way. |
Beta Was this translation helpful? Give feedback.
-
So, I'm not sure about these comments. These are not answers for my question. My question was on how |
Beta Was this translation helpful? Give feedback.
-
The code is relatively simple so you can just try reading one backend, like e.g. Once you run the loop, with one of the run APIs, you pass some The What each backend uses for I'd also suggest to read the loop {
event_loop.poll_events(timeout, &mut event_buffer);
user_state.new_events(&event_loop);
for event in event_buffer {
user_state.dispatch(&event_loop, event); // Just call the right method
}
user_state.about_to_wait(&event_loop);
} The 0.29 works exactly the same btw, it's just instead of state there's a But again, it's better to get familiar with a particular backend and ask particular maintainer in the matrix room if you're more curious how things work, I can consult on like(in order of my understanding) Wayland, X11, macOS, and general stuff. |
Beta Was this translation helpful? Give feedback.
The code is relatively simple so you can just try reading one backend, like e.g.
wayland
one, they are more traditional. But basically, the event loop is usually something likeepoll
(depends on the platform, I'd use epoll for simpliticy), this is what is behind the
EventLoop` itself.Once you run the loop, with one of the run APIs, you pass some
state: &mut dyn ApplicationHandler
(just a fat pointer to something implementing the trait), and then winit calls back to you once it gets event from the windowing system.The
ActiveEventLoop
is the same asEventLoop
under the hood, it's just a different type to make calls more safe to do, because on e.g. macOS you could be required to have event…