diff --git a/CHANGELOG.md b/CHANGELOG.md index 20bee8e2..a59b29f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/codegen/apipatcher.py b/codegen/apipatcher.py index 5449cbda..3acd0859 100644 --- a/codegen/apipatcher.py +++ b/codegen/apipatcher.py @@ -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 diff --git a/codegen/apiwriter.py b/codegen/apiwriter.py index 798e30da..8656776f 100644 --- a/codegen/apiwriter.py +++ b/codegen/apiwriter.py @@ -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 @@ -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(): @@ -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") diff --git a/wgpu/_version.py b/wgpu/_version.py index 0ae1c8f4..8e2f07d9 100644 --- a/wgpu/_version.py +++ b/wgpu/_version.py @@ -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" diff --git a/wgpu/utils/imgui/imgui_renderer.py b/wgpu/utils/imgui/imgui_renderer.py index 36513ff7..053af617 100644 --- a/wgpu/utils/imgui/imgui_renderer.py +++ b/wgpu/utils/imgui/imgui_renderer.py @@ -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