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
* invert context wrapper control
* go one step further
* clean up a bit
* attempt to clear out get_physical_size and vsync, remove dummy canvas
* cleanup
* Work with new rendercanvas, and clean up some of the bitmap presenting
* Provide public method to create CanvasContext
* Remove references to CanvasInterface
* Prefer canvas.get_wgpu_context() over canvas.get_context('wgpu')
* clean/docs
* codegen
* fix
* Adjust triangle example too
* forgot to update triangle.glsl
* pin rendercanvas to future release
* add prop to get physical size
* fix typos
* Adjust docstring for pyodide
* codegen
* fix memtests
* ruff
* update examples
* make a prop
* codgen
---------
Co-authored-by: Almar Klein <almar@almarklein.org>
Copy file name to clipboardExpand all lines: docs/wgpu.rst
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,16 +72,14 @@ The async methods return a :class:`GPUPromise`, which resolves to the actual res
72
72
* In sync code, you can use ``promise.sync_wait()``. This is similar to the ``_sync()`` flavour mentioned above (it makes your code less portable).
73
73
74
74
75
-
Canvas API
76
-
----------
77
-
78
-
In order for wgpu to render to a canvas (which can be on screen, inside a GUI, offscreen, etc.),
79
-
a canvas object is needed. We recommend using the `rendercanvas <https://github.com/pygfx/rendercanvas>`_ library to get a wide variety of canvases.
80
-
81
-
That said, the canvas object can be any object, as long as it adheres to the
82
-
``WgpuCanvasInterface``, see https://github.com/pygfx/wgpu-py/blob/main/wgpu/_canvas.py for details.
75
+
Rendering to a canvas
76
+
---------------------
83
77
78
+
In order for wgpu to render to a canvas (which can be on screen, inside a GUI,
79
+
offscreen, etc.), we highly recommend using the `rendercanvas <https://github.com/pygfx/rendercanvas>`_ library.
80
+
One can then use ``canvas.get_wgpu_context()`` to get a `WgpuContext <https://rendercanvas.readthedocs.io/stable/contexts.html#rendercanvas.contexts.WgpuContext>`_.
84
81
82
+
For more low-level control, use ```wgpu.gpu.get_canvas_context()`` to get a :class:`GPUCanvasContext` object for drawing directly to a window on screen.
0 commit comments