@luma.gl/webgl 9.0.0-alpha.36 → 9.0.0-alpha.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dist.dev.js CHANGED
@@ -1226,6 +1226,13 @@ var __exports__ = (() => {
1226
1226
  }
1227
1227
  // Canvas context
1228
1228
  /** Default / primary canvas context. Can be null as WebGPU devices can be created without a CanvasContext */
1229
+ /** Returns the default / primary canvas context. Throws an error if no canvas context is available (a WebGPU compute device) */
1230
+ getCanvasContext() {
1231
+ if (!this.canvasContext) {
1232
+ throw new Error("Device has no CanvasContext");
1233
+ }
1234
+ return this.canvasContext;
1235
+ }
1229
1236
  /** Creates a new CanvasContext (WebGPU only) */
1230
1237
  /** Call after rendering a frame (necessary e.g. on WebGL OffscreenCanvas) */
1231
1238
  // Resource creation