Skip to content

Commit

Permalink
Attempt at better testing???
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaarrfk authored and Korijn committed Dec 30, 2024
1 parent b42988e commit c741963
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions examples/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import wgpu
import numpy as np

from wgpu.gui.auto import WgpuCanvas, run


# %% Entrypoints (sync and async)

Expand Down Expand Up @@ -453,21 +455,21 @@ async def draw_frame_async():
uniform_data = np.zeros((), dtype=uniform_dtype)


if True or __name__ == "__main__":
from wgpu.gui.auto import WgpuCanvas, run
print("Available adapters on this system:")
for a in wgpu.gpu.enumerate_adapters_sync():
print(a.summary)

print("Available adapters on this system:")
for a in wgpu.gpu.enumerate_adapters_sync():
print(a.summary)
canvas = WgpuCanvas(size=(640, 480), title="wgpu cube example")

canvas = WgpuCanvas(size=(640, 480), title="wgpu cube example")
draw_frame = setup_drawing_sync(canvas)

draw_frame = setup_drawing_sync(canvas)

def animate():
draw_frame()
canvas.request_draw()
def animate():
draw_frame()
canvas.request_draw()


canvas.request_draw(animate)
canvas.request_draw(animate)

if __name__ == "__main__":
run()

0 comments on commit c741963

Please sign in to comment.