Skip to content

Commit

Permalink
expose loop.run for backwards compat
Browse files Browse the repository at this point in the history
  • Loading branch information
almarklein committed Oct 25, 2024
1 parent fe9f63e commit edf5706
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wgpu/gui/auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
for e.g. wx later. Or we might decide to stick with these three.
"""

__all__ = ["WgpuCanvas", "loop"]
__all__ = ["WgpuCanvas", "loop", "run"]

import os
import sys
Expand Down Expand Up @@ -189,3 +189,4 @@ def backends_by_trying_in_order():
# Load!
module = select_backend()
WgpuCanvas, loop = module.WgpuCanvas, module.loop
run = loop.run # backwards compat
1 change: 1 addition & 0 deletions wgpu/gui/glfw.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ def _run(self):


loop = GlfwAsyncioWgpuLoop()
run = loop.run # backwards compat


def poll_glfw_briefly(poll_time=0.1):
Expand Down
1 change: 1 addition & 0 deletions wgpu/gui/qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,3 +599,4 @@ def _wgpu_gui_poll(self):


loop = QtWgpuLoop()
run = loop.run # backwards compat
1 change: 1 addition & 0 deletions wgpu/gui/wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,3 +568,4 @@ def process_wx_events(self):


loop = WxWgpuLoop()
run = loop.run # backwards compat

0 comments on commit edf5706

Please sign in to comment.