diff --git a/examples/noise.py b/examples/noise.py index e97df57..8b4870e 100644 --- a/examples/noise.py +++ b/examples/noise.py @@ -8,7 +8,7 @@ # run_example = true import numpy as np -from rendercanvas.auto import RenderCanvas, loop +from rendercanvas.pyside6 import RenderCanvas, loop canvas = RenderCanvas(update_mode="continuous") diff --git a/rendercanvas/utils/bitmappresentadapter.py b/rendercanvas/utils/bitmappresentadapter.py index 3275906..12704e1 100644 --- a/rendercanvas/utils/bitmappresentadapter.py +++ b/rendercanvas/utils/bitmappresentadapter.py @@ -36,7 +36,8 @@ def present_bitmap(self, bitmap): self._texture_helper.set_texture_data(bitmap) if not self._context_is_configured: - self._context.configure(device=self._device, format="rgba8unorm") + format = self._context.get_preferred_format(self._device.adapter) + self._context.configure(device=self._device, format=format) target = self._context.get_current_texture().create_view() command_encoder = self._device.create_command_encoder()