Skip to content

Fix ImguiRenderer and simplify gui callback function - #730

Merged
Korijn merged 2 commits into
pygfx:mainfrom
panxinmiao:fix-imgui
Aug 8, 2025
Merged

Fix ImguiRenderer and simplify gui callback function#730
Korijn merged 2 commits into
pygfx:mainfrom
panxinmiao:fix-imgui

Conversation

@panxinmiao

Copy link
Copy Markdown
Contributor

This PR fixes an occasional issue in ImguiRenderer that could occur during window resizing. Specifically, we should obtain the frame's imgui draw_data after updating backend.io.display_size.

In addition, we previously modified the API in #539 to introduce a GUI update hook function for ImguiRenderer. This hook can be further simplified—users should only need to write their GUI logic within the function, without having to include repetitive boilerplate code such as obtaining draw_data.

While this API change is not urgent—since modifying the interface could introduce compatibility issues for downstream projects—it’s a good opportunity to streamline the API, given the major update to ImGui v1.92 in #725 .

@panxinmiao
panxinmiao requested a review from Korijn as a code owner August 6, 2025 05:38
Comment thread wgpu/utils/imgui/imgui_renderer.py
Comment thread wgpu/utils/imgui/imgui_renderer.py Outdated
Korijn
Korijn previously approved these changes Aug 7, 2025
Co-authored-by: Korijn van Golen <korijn@gmail.com>
@Korijn
Korijn merged commit 60f72fd into pygfx:main Aug 8, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants