Skip to content

fix imgui example #711

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/imgui_backend_sea.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,9 @@ def render():
render_pass.draw(3, 1)

# draw imgui
psize = canvas.get_physical_size()
imgui_data = gui(app_state)
imgui_backend.render(imgui_data, render_pass)
imgui_backend.render(imgui_data, render_pass, psize)

render_pass.end()

Expand Down
2 changes: 2 additions & 0 deletions wgpu/utils/imgui/imgui_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ def render(
The draw data to render, this is usually obtained by calling ``imgui.get_draw_data()``
render_pass : wgpu.GPURenderPassEncoder
The render pass to render the imgui draw data with
psize : tuple(int, int)
The physical size of the canvas, get from calling ``canvas.get_physical_size()``
"""
if draw_data is None:
return
Expand Down