Skip to content

Commit

Permalink
Merge branch 'main' into async_handler
Browse files Browse the repository at this point in the history
  • Loading branch information
almarklein committed Dec 6, 2024
2 parents c4d2388 + c5108ac commit 9faec92
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ Possible sections in each release:
* Security: in case of vulnerabilities.


### [v0.19.2] - 25-11-2024

Changed:

* Update to Imgui 1.6+ by @panxinmiao in https://github.com/pygfx/wgpu-py/pull/645


### [v0.19.1] - 19-11-2024

Some internal refactoring, fix the doc theme, and compatibility with rendercanvas.
Expand Down
2 changes: 1 addition & 1 deletion codegen/apipatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def patch_base_api(code):
if found_all:
part2 = part2.split("]", 1)[-1]
line = "\n__all__ = ["
line += ", ".join(f'"{name}"' for name in idl.classes.keys())
line += ", ".join(f'"{name}"' for name in sorted(idl.classes.keys()))
line += "]"
code = part1 + line + part2

Expand Down
6 changes: 3 additions & 3 deletions codegen/apiwriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def write_flags():
# List'm
pylines.append(f"# There are {n} flags\n")
pylines.append("__all__ = [")
for name in idl.flags.keys():
for name in sorted(idl.flags.keys()):
pylines.append(f' "{name}",')
pylines.append("]\n\n")
# The flags definitions
Expand Down Expand Up @@ -78,7 +78,7 @@ def write_enums():
# List'm
pylines.append(f"# There are {n} enums\n")
pylines.append("__all__ = [")
for name in idl.enums.keys():
for name in sorted(idl.enums.keys()):
pylines.append(f' "{name}",')
pylines.append("]\n\n")
for name, d in idl.enums.items():
Expand Down Expand Up @@ -108,7 +108,7 @@ def write_structs():
pylines.append(f"# There are {n} structs\n")
# List'm
pylines.append("__all__ = [")
for name in idl.structs.keys():
for name in sorted(idl.structs.keys()):
if name not in ignore:
pylines.append(f' "{name}",')
pylines.append("]\n\n")
Expand Down
2 changes: 1 addition & 1 deletion wgpu/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

# This is the reference version number, to be bumped before each release.
# The build system detects this definition when building a distribution.
__version__ = "0.19.1"
__version__ = "0.19.2"

# Allow using nearly the same code in different projects
project_name = "wgpu"
Expand Down
26 changes: 20 additions & 6 deletions wgpu/utils/imgui/imgui_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,26 @@ class ImguiRenderer:
"Tab": imgui.Key.tab,
}

KEY_MAP_MOD = {
"Shift": imgui.Key.im_gui_mod_shift,
"Control": imgui.Key.im_gui_mod_ctrl,
"Alt": imgui.Key.im_gui_mod_alt,
"Meta": imgui.Key.im_gui_mod_super,
}
# imgui changed its API between 1.5.2 and 1.6.0
# But as of Dec 1, 2024, it is too early for us to force
# users to use one specific version.
# So we will support both versions for now with this small shim
try:
# Version 1.6.0 and above
KEY_MAP_MOD = {
"Shift": imgui.Key.mod_shift,
"Control": imgui.Key.mod_ctrl,
"Alt": imgui.Key.mod_alt,
"Meta": imgui.Key.mod_super,
}
except AttributeError:
# Version 1.2.1 to 1.5.2
KEY_MAP_MOD = {
"Shift": imgui.Key.im_gui_mod_shift,
"Control": imgui.Key.im_gui_mod_ctrl,
"Alt": imgui.Key.im_gui_mod_alt,
"Meta": imgui.Key.im_gui_mod_super,
}

def __init__(
self, device, canvas: wgpu.gui.WgpuCanvasBase, render_target_format=None
Expand Down

0 comments on commit 9faec92

Please sign in to comment.