ExternalRenderTarget.platform constructor

ExternalRenderTarget.platform(
  1. Object handle, {
  2. required int width,
  3. required int height,
  4. ExternalTargetHandleKind kind = gpu.ExternalTargetHandleKind.framebuffer,
  5. PixelFormat format = gpu.PixelFormat.r8g8b8a8UNormInt,
  6. Color? backgroundColor,
})

Wraps a platform object the active backend can draw into, through wrapExternalColorTarget (see that function for what each backend accepts). Throws UnsupportedError where the backend cannot.

Implementation

ExternalRenderTarget.platform(
  Object handle, {
  required int width,
  required int height,
  gpu.ExternalTargetHandleKind kind =
      gpu.ExternalTargetHandleKind.framebuffer,
  gpu.PixelFormat format = gpu.PixelFormat.r8g8b8a8UNormInt,
  this.backgroundColor,
}) : surfaceFrame = null,
     color = targets.wrapExternalColorTarget(
       handle,
       width: width,
       height: height,
       kind: kind,
       format: format,
     );