Replies: 1 comment 1 reply
-
|
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I’m writing a GPU raytracer using wgpu (version 22.0.0) and winit (0.30.4). I’m rendering images to the screen successfully, and I would now like to add GUI support so that I can change some render parameters in real-time.
Imgui seemed simple. I copied the imgui-winit-support and imgui-wgpu files locally and did some simple updates to get the initialization code working. This code lives in the resumed function call, done when I initialize my window and wgpu_state (which contains my device and queue for example).
I’m struggling to understand where in the event loop scheme the actual imgui code would go. In older examples, there was a MainEventsCleared event, and it appears that all of the render timers and GUI specific code was stored there. I was thinking perhaps that this code now belongs in the new_events function, but I’m not really sure and don’t have a lot of experience with this stuff. I’ve basically been learning by example.
Essentially, I don’t understand the difference between the window_event function and the new_event function, which is called first, whether the GUI stuff needs to be handled as a window_event or can be something else, etc.
Any advice appreciated!!
Beta Was this translation helpful? Give feedback.
All reactions