Skip to content

Commit

Permalink
Fix rendering via bitmap adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
almarklein committed Dec 10, 2024
1 parent a6d7c02 commit 3ccf8a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion rendercanvas/utils/bitmappresentadapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3ccf8a7

Please sign in to comment.