You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-13Lines changed: 19 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,23 +21,29 @@ See how the two windows above look the same? That's the idea; they also look the
21
21
same to the code that renders to them. Yet, the GUI systems are very different
22
22
(Qt vs glfw in this case). Now that's a powerful abstraction!
23
23
24
-
Coming from `wgpu.gui`? Check [from_wgpu_canvas.md](from_wgpu_canvas.md).
25
24
26
25
27
26
## Purpose
28
27
29
-
* Provide a generic canvas API to render to.
30
-
* Provide an event loop for scheduling events and draws.
31
-
* Provide a simple but powerful event system with standardized event objects.
32
-
* Provide various canvas implementations:
33
-
* One that is light and easily installed (glfw).
34
-
* For various GUI libraries (e.g. qt and wx), so visuzalizations can be embedded in a GUI.
35
-
* For specific platforms (e.g. Jupyter, browser).
28
+
Providing a generic API for:
36
29
30
+
* managing a canvas window ([`BaseRenderCanvas`](https://rendercanvas.readthedocs.io/stable/api.html)).
31
+
* presenting rendered results with `wgpu` ([`WgpuContext`](https://rendercanvas.readthedocs.io/stable/contexts.html#rendercanvas.contexts.WgpuContext)).
32
+
* presenting rendered results as a bitmap ([`BitmapContext`](https://rendercanvas.readthedocs.io/stable/contexts.html#rendercanvas.contexts.BitmapContext)).
33
+
* working with events that have standardized behavior.
37
34
38
-
The main use-case is rendering with [wgpu](https://github.com/pygfx/wgpu-py),
39
-
but ``rendercanvas``can be used by anything that can render based on a window-id or
40
-
by producing bitmap images.
35
+
Implement that on top of a variety of backends:
36
+
37
+
* Running on desktop with a light backend (glfw).
38
+
* Running in the browser (with Pyodide or PyScript).
39
+
* Running from a (Jupyter) notebook.
40
+
* Embedding as a widget in a GUI library.
41
+
* Qt
42
+
* wx
43
+
* In addition to the GUI libraries mentioned above, the following event loops are supported:
44
+
* asyncio
45
+
* trio
46
+
* raw
41
47
42
48
43
49
## Installation
@@ -109,8 +115,8 @@ app.exec()
109
115
110
116
## Async or not async
111
117
112
-
We support both; a render canvas can be used in a fully async setting using e.g. Asyncio or Trio, or in an event-drived framework like Qt.
113
-
If you like callbacks, ``loop.call_later()`` always works. If you like async, use ``loop.add_task()``. Event handlers can always be async.
118
+
We support both; a render canvas can be used in a fully async setting using e.g. Asyncio or Trio, or in an event-driven framework like Qt.
119
+
If you like callbacks, ``loop.call_later()`` always works. If you like async, use ``loop.add_task()``.
114
120
See the [docs on async](https://rendercanvas.readthedocs.io/stable/start.html#async) for details.
0 commit comments