From 1a17427e65198a9406cb7fe2ac1283aa10e02ca2 Mon Sep 17 00:00:00 2001 From: Almar Klein Date: Thu, 24 Oct 2024 10:35:24 +0200 Subject: [PATCH] tweak example and ruff --- examples/gui_events.py | 8 +++++++- examples/wgpu-examples.ipynb | 2 +- wgpu/gui/base.py | 1 - 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/gui_events.py b/examples/gui_events.py index b390ca6f..9bdff075 100644 --- a/examples/gui_events.py +++ b/examples/gui_events.py @@ -11,7 +11,13 @@ from cube import setup_drawing_sync -canvas = WgpuCanvas(size=(640, 480), title="wgpu events", max_fps=10) +canvas = WgpuCanvas( + size=(640, 480), + title="wgpu events", + max_fps=10, + update_mode="continuous", + present_method="screen", +) draw_frame = setup_drawing_sync(canvas) canvas.request_draw(lambda: (draw_frame(), canvas.request_draw())) diff --git a/examples/wgpu-examples.ipynb b/examples/wgpu-examples.ipynb index d7bf123d..6a663887 100644 --- a/examples/wgpu-examples.ipynb +++ b/examples/wgpu-examples.ipynb @@ -129,7 +129,7 @@ "source": [ "from cube import setup_drawing_sync\n", "\n", - "canvas = WgpuCanvas(size=(640, 480), max_fps= 10, update_mode='continuous')\n", + "canvas = WgpuCanvas(size=(640, 480), max_fps=10, update_mode=\"continuous\")\n", "\n", "draw_frame = setup_drawing_sync(canvas)\n", "canvas.request_draw(draw_frame)\n", diff --git a/wgpu/gui/base.py b/wgpu/gui/base.py index ecc09019..31199dbc 100644 --- a/wgpu/gui/base.py +++ b/wgpu/gui/base.py @@ -242,7 +242,6 @@ def _draw_frame_and_present(self): self.__is_drawing = True try: - # This method is called from the GUI layer. It can be called from a # "draw event" that we requested, or as part of a forced draw.