From c74196370d03a6238ed3640f4c62128e75336dda Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Sun, 29 Dec 2024 20:20:34 -0500 Subject: [PATCH] Attempt at better testing??? --- examples/cube.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/examples/cube.py b/examples/cube.py index 1df6e458..153bfe94 100644 --- a/examples/cube.py +++ b/examples/cube.py @@ -15,6 +15,8 @@ import wgpu import numpy as np +from wgpu.gui.auto import WgpuCanvas, run + # %% Entrypoints (sync and async) @@ -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()