W3cubDocs

/Dart 2

getContext3d method

  1. @SupportedBrowser(SupportedBrowser.CHROME)
  2. @SupportedBrowser(SupportedBrowser.FIREFOX)
RenderingContext getContext3d ({dynamic alpha: true, dynamic depth: true, dynamic stencil: false, dynamic antialias: true, dynamic premultipliedAlpha: true, dynamic preserveDrawingBuffer: false })
@SupportedBrowser(SupportedBrowser.CHROME), @SupportedBrowser(SupportedBrowser.FIREFOX)

Returns a new Web GL context for this canvas.

Other resources

Implementation

@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
gl.RenderingContext getContext3d(
    {alpha: true,
    depth: true,
    stencil: false,
    antialias: true,
    premultipliedAlpha: true,
    preserveDrawingBuffer: false}) {
  var options = {
    'alpha': alpha,
    'depth': depth,
    'stencil': stencil,
    'antialias': antialias,
    'premultipliedAlpha': premultipliedAlpha,
    'preserveDrawingBuffer': preserveDrawingBuffer,
  };
  var context = getContext('webgl', options);
  if (context == null) {
    context = getContext('experimental-webgl', options);
  }
  return context;
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.5.0/dart-html/CanvasElement/getContext3d.html