blob: 473059fb022951c3ab525c8b9d053761dc102612 [file] [log] [blame]
/**
* 3D programming in the browser.
*
* {@category Web}
*/
library dart.dom.web_gl;
import 'dart:async';
import 'dart:collection' hide LinkedList, LinkedListEntry;
import 'dart:_internal' show FixedLengthListMixin;
import 'dart:html';
import 'dart:html_common';
import 'dart:_native_typed_data';
import 'dart:typed_data';
import 'dart:_js_helper'
show Creates, JSName, Native, Returns, convertDartClosureToJS;
import 'dart:_foreign_helper' show JS;
import 'dart:_interceptors' show JavaScriptObject, JSExtendableArray;
// DO NOT EDIT - unless you are editing documentation as per:
// https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
// Auto-generated dart:web_gl library.
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Unstable()
@Native("WebGLActiveInfo")
class ActiveInfo extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ActiveInfo._() {
throw new UnsupportedError("Not supported");
}
String get name native;
int get size native;
int get type native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("ANGLEInstancedArrays,ANGLE_instanced_arrays")
class AngleInstancedArrays extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory AngleInstancedArrays._() {
throw new UnsupportedError("Not supported");
}
static const int VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE;
@JSName('drawArraysInstancedANGLE')
void drawArraysInstancedAngle(int mode, int first, int count, int primcount)
native;
@JSName('drawElementsInstancedANGLE')
void drawElementsInstancedAngle(
int mode, int count, int type, int offset, int primcount) native;
@JSName('vertexAttribDivisorANGLE')
void vertexAttribDivisorAngle(int index, int divisor) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Unstable()
@Native("WebGLBuffer")
class Buffer extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory Buffer._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLCanvas")
class Canvas extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory Canvas._() {
throw new UnsupportedError("Not supported");
}
@JSName('canvas')
CanvasElement get canvas native;
@JSName('canvas')
OffscreenCanvas? get offscreenCanvas native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLColorBufferFloat")
class ColorBufferFloat extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ColorBufferFloat._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLCompressedTextureASTC")
class CompressedTextureAstc extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory CompressedTextureAstc._() {
throw new UnsupportedError("Not supported");
}
static const int COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB;
static const int COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8;
static const int COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9;
static const int COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA;
static const int COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC;
static const int COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD;
static const int COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0;
static const int COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1;
static const int COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2;
static const int COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3;
static const int COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4;
static const int COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5;
static const int COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6;
static const int COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6;
static const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLCompressedTextureATC,WEBGL_compressed_texture_atc")
class CompressedTextureAtc extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory CompressedTextureAtc._() {
throw new UnsupportedError("Not supported");
}
static const int COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8C93;
static const int COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 0x87EE;
static const int COMPRESSED_RGB_ATC_WEBGL = 0x8C92;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLCompressedTextureETC1,WEBGL_compressed_texture_etc1")
class CompressedTextureETC1 extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory CompressedTextureETC1._() {
throw new UnsupportedError("Not supported");
}
static const int COMPRESSED_RGB_ETC1_WEBGL = 0x8D64;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLCompressedTextureETC")
class CompressedTextureEtc extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory CompressedTextureEtc._() {
throw new UnsupportedError("Not supported");
}
static const int COMPRESSED_R11_EAC = 0x9270;
static const int COMPRESSED_RG11_EAC = 0x9272;
static const int COMPRESSED_RGB8_ETC2 = 0x9274;
static const int COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276;
static const int COMPRESSED_RGBA8_ETC2_EAC = 0x9278;
static const int COMPRESSED_SIGNED_R11_EAC = 0x9271;
static const int COMPRESSED_SIGNED_RG11_EAC = 0x9273;
static const int COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279;
static const int COMPRESSED_SRGB8_ETC2 = 0x9275;
static const int COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLCompressedTexturePVRTC,WEBGL_compressed_texture_pvrtc")
class CompressedTexturePvrtc extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory CompressedTexturePvrtc._() {
throw new UnsupportedError("Not supported");
}
static const int COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
static const int COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
static const int COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01;
static const int COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLCompressedTextureS3TC,WEBGL_compressed_texture_s3tc")
class CompressedTextureS3TC extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory CompressedTextureS3TC._() {
throw new UnsupportedError("Not supported");
}
static const int COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
static const int COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
static const int COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
static const int COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLCompressedTextureS3TCsRGB")
class CompressedTextureS3TCsRgb extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory CompressedTextureS3TCsRgb._() {
throw new UnsupportedError("Not supported");
}
static const int COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D;
static const int COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E;
static const int COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F;
static const int COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Unstable()
@Native("WebGLContextEvent")
class ContextEvent extends Event {
// To suppress missing implicit constructor warnings.
factory ContextEvent._() {
throw new UnsupportedError("Not supported");
}
factory ContextEvent(String type, [Map? eventInit]) {
if (eventInit != null) {
var eventInit_1 = convertDartToNative_Dictionary(eventInit);
return ContextEvent._create_1(type, eventInit_1);
}
return ContextEvent._create_2(type);
}
static ContextEvent _create_1(type, eventInit) =>
JS('ContextEvent', 'new WebGLContextEvent(#,#)', type, eventInit);
static ContextEvent _create_2(type) =>
JS('ContextEvent', 'new WebGLContextEvent(#)', type);
String get statusMessage native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLDebugRendererInfo,WEBGL_debug_renderer_info")
class DebugRendererInfo extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory DebugRendererInfo._() {
throw new UnsupportedError("Not supported");
}
static const int UNMASKED_RENDERER_WEBGL = 0x9246;
static const int UNMASKED_VENDOR_WEBGL = 0x9245;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLDebugShaders,WEBGL_debug_shaders")
class DebugShaders extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory DebugShaders._() {
throw new UnsupportedError("Not supported");
}
String? getTranslatedShaderSource(Shader shader) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLDepthTexture,WEBGL_depth_texture")
class DepthTexture extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory DepthTexture._() {
throw new UnsupportedError("Not supported");
}
static const int UNSIGNED_INT_24_8_WEBGL = 0x84FA;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLDrawBuffers,WEBGL_draw_buffers")
class DrawBuffers extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory DrawBuffers._() {
throw new UnsupportedError("Not supported");
}
@JSName('drawBuffersWEBGL')
void drawBuffersWebgl(List<int> buffers) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTsRGB,EXT_sRGB")
class EXTsRgb extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory EXTsRgb._() {
throw new UnsupportedError("Not supported");
}
static const int FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 0x8210;
static const int SRGB8_ALPHA8_EXT = 0x8C43;
static const int SRGB_ALPHA_EXT = 0x8C42;
static const int SRGB_EXT = 0x8C40;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTBlendMinMax,EXT_blend_minmax")
class ExtBlendMinMax extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ExtBlendMinMax._() {
throw new UnsupportedError("Not supported");
}
static const int MAX_EXT = 0x8008;
static const int MIN_EXT = 0x8007;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTColorBufferFloat")
class ExtColorBufferFloat extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ExtColorBufferFloat._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTColorBufferHalfFloat")
class ExtColorBufferHalfFloat extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ExtColorBufferHalfFloat._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTDisjointTimerQuery")
class ExtDisjointTimerQuery extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ExtDisjointTimerQuery._() {
throw new UnsupportedError("Not supported");
}
static const int CURRENT_QUERY_EXT = 0x8865;
static const int GPU_DISJOINT_EXT = 0x8FBB;
static const int QUERY_COUNTER_BITS_EXT = 0x8864;
static const int QUERY_RESULT_AVAILABLE_EXT = 0x8867;
static const int QUERY_RESULT_EXT = 0x8866;
static const int TIMESTAMP_EXT = 0x8E28;
static const int TIME_ELAPSED_EXT = 0x88BF;
@JSName('beginQueryEXT')
void beginQueryExt(int target, TimerQueryExt query) native;
@JSName('createQueryEXT')
TimerQueryExt createQueryExt() native;
@JSName('deleteQueryEXT')
void deleteQueryExt(TimerQueryExt? query) native;
@JSName('endQueryEXT')
void endQueryExt(int target) native;
@JSName('getQueryEXT')
Object? getQueryExt(int target, int pname) native;
@JSName('getQueryObjectEXT')
Object? getQueryObjectExt(TimerQueryExt query, int pname) native;
@JSName('isQueryEXT')
bool isQueryExt(TimerQueryExt? query) native;
@JSName('queryCounterEXT')
void queryCounterExt(TimerQueryExt query, int target) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTDisjointTimerQueryWebGL2")
class ExtDisjointTimerQueryWebGL2 extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ExtDisjointTimerQueryWebGL2._() {
throw new UnsupportedError("Not supported");
}
static const int GPU_DISJOINT_EXT = 0x8FBB;
static const int QUERY_COUNTER_BITS_EXT = 0x8864;
static const int TIMESTAMP_EXT = 0x8E28;
static const int TIME_ELAPSED_EXT = 0x88BF;
@JSName('queryCounterEXT')
void queryCounterExt(Query query, int target) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTFragDepth,EXT_frag_depth")
class ExtFragDepth extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ExtFragDepth._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTShaderTextureLOD,EXT_shader_texture_lod")
class ExtShaderTextureLod extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ExtShaderTextureLod._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("EXTTextureFilterAnisotropic,EXT_texture_filter_anisotropic")
class ExtTextureFilterAnisotropic extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ExtTextureFilterAnisotropic._() {
throw new UnsupportedError("Not supported");
}
static const int MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
static const int TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Unstable()
@Native("WebGLFramebuffer")
class Framebuffer extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory Framebuffer._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLGetBufferSubDataAsync")
class GetBufferSubDataAsync extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory GetBufferSubDataAsync._() {
throw new UnsupportedError("Not supported");
}
Future getBufferSubDataAsync(int target, int srcByteOffset, TypedData dstData,
[int? dstOffset, int? length]) =>
promiseToFuture(JS("", "#.getBufferSubDataAsync(#, #, #, #, #)", this,
target, srcByteOffset, dstData, dstOffset, length));
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLLoseContext,WebGLExtensionLoseContext,WEBGL_lose_context")
class LoseContext extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory LoseContext._() {
throw new UnsupportedError("Not supported");
}
void loseContext() native;
void restoreContext() native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("OESElementIndexUint,OES_element_index_uint")
class OesElementIndexUint extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory OesElementIndexUint._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("OESStandardDerivatives,OES_standard_derivatives")
class OesStandardDerivatives extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory OesStandardDerivatives._() {
throw new UnsupportedError("Not supported");
}
static const int FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("OESTextureFloat,OES_texture_float")
class OesTextureFloat extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory OesTextureFloat._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("OESTextureFloatLinear,OES_texture_float_linear")
class OesTextureFloatLinear extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory OesTextureFloatLinear._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("OESTextureHalfFloat,OES_texture_half_float")
class OesTextureHalfFloat extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory OesTextureHalfFloat._() {
throw new UnsupportedError("Not supported");
}
static const int HALF_FLOAT_OES = 0x8D61;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("OESTextureHalfFloatLinear,OES_texture_half_float_linear")
class OesTextureHalfFloatLinear extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory OesTextureHalfFloatLinear._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("OESVertexArrayObject,OES_vertex_array_object")
class OesVertexArrayObject extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory OesVertexArrayObject._() {
throw new UnsupportedError("Not supported");
}
static const int VERTEX_ARRAY_BINDING_OES = 0x85B5;
@JSName('bindVertexArrayOES')
void bindVertexArray(VertexArrayObjectOes? arrayObject) native;
@JSName('createVertexArrayOES')
VertexArrayObjectOes createVertexArray() native;
@JSName('deleteVertexArrayOES')
void deleteVertexArray(VertexArrayObjectOes? arrayObject) native;
@JSName('isVertexArrayOES')
bool isVertexArray(VertexArrayObjectOes? arrayObject) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Unstable()
@Native("WebGLProgram")
class Program extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory Program._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLQuery")
class Query extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory Query._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Unstable()
@Native("WebGLRenderbuffer")
class Renderbuffer extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory Renderbuffer._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@Unstable()
@Native("WebGLRenderingContext")
class RenderingContext extends JavaScriptObject
implements CanvasRenderingContext {
// To suppress missing implicit constructor warnings.
factory RenderingContext._() {
throw new UnsupportedError("Not supported");
}
/// Checks if this type is supported on the current platform.
static bool get supported => JS('bool', '!!(window.WebGLRenderingContext)');
CanvasElement get canvas native;
// From WebGLRenderingContextBase
int? get drawingBufferHeight native;
int? get drawingBufferWidth native;
void activeTexture(int texture) native;
void attachShader(Program program, Shader shader) native;
void bindAttribLocation(Program program, int index, String name) native;
void bindBuffer(int target, Buffer? buffer) native;
void bindFramebuffer(int target, Framebuffer? framebuffer) native;
void bindRenderbuffer(int target, Renderbuffer? renderbuffer) native;
void bindTexture(int target, Texture? texture) native;
void blendColor(num red, num green, num blue, num alpha) native;
void blendEquation(int mode) native;
void blendEquationSeparate(int modeRGB, int modeAlpha) native;
void blendFunc(int sfactor, int dfactor) native;
void blendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha)
native;
void bufferData(int target, data_OR_size, int usage) native;
void bufferSubData(int target, int offset, data) native;
int checkFramebufferStatus(int target) native;
void clear(int mask) native;
void clearColor(num red, num green, num blue, num alpha) native;
void clearDepth(num depth) native;
void clearStencil(int s) native;
void colorMask(bool red, bool green, bool blue, bool alpha) native;
Future commit() => promiseToFuture(JS("", "#.commit()", this));
void compileShader(Shader shader) native;
void compressedTexImage2D(int target, int level, int internalformat,
int width, int height, int border, TypedData data) native;
void compressedTexSubImage2D(int target, int level, int xoffset, int yoffset,
int width, int height, int format, TypedData data) native;
void copyTexImage2D(int target, int level, int internalformat, int x, int y,
int width, int height, int border) native;
void copyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x,
int y, int width, int height) native;
Buffer createBuffer() native;
Framebuffer createFramebuffer() native;
Program createProgram() native;
Renderbuffer createRenderbuffer() native;
Shader createShader(int type) native;
Texture createTexture() native;
void cullFace(int mode) native;
void deleteBuffer(Buffer? buffer) native;
void deleteFramebuffer(Framebuffer? framebuffer) native;
void deleteProgram(Program? program) native;
void deleteRenderbuffer(Renderbuffer? renderbuffer) native;
void deleteShader(Shader? shader) native;
void deleteTexture(Texture? texture) native;
void depthFunc(int func) native;
void depthMask(bool flag) native;
void depthRange(num zNear, num zFar) native;
void detachShader(Program program, Shader shader) native;
void disable(int cap) native;
void disableVertexAttribArray(int index) native;
void drawArrays(int mode, int first, int count) native;
void drawElements(int mode, int count, int type, int offset) native;
void enable(int cap) native;
void enableVertexAttribArray(int index) native;
void finish() native;
void flush() native;
void framebufferRenderbuffer(int target, int attachment,
int renderbuffertarget, Renderbuffer? renderbuffer) native;
void framebufferTexture2D(int target, int attachment, int textarget,
Texture? texture, int level) native;
void frontFace(int mode) native;
void generateMipmap(int target) native;
ActiveInfo getActiveAttrib(Program program, int index) native;
ActiveInfo getActiveUniform(Program program, int index) native;
List<Shader>? getAttachedShaders(Program program) native;
int getAttribLocation(Program program, String name) native;
@Creates('int|Null')
@Returns('int|Null')
Object? getBufferParameter(int target, int pname) native;
@Creates('ContextAttributes|Null')
Map? getContextAttributes() {
return convertNativeToDart_Dictionary(_getContextAttributes_1());
}
@JSName('getContextAttributes')
@Creates('ContextAttributes|Null')
_getContextAttributes_1() native;
int getError() native;
Object? getExtension(String name) native;
@Creates('int|Renderbuffer|Texture|Null')
@Returns('int|Renderbuffer|Texture|Null')
Object? getFramebufferAttachmentParameter(
int target, int attachment, int pname) native;
@Creates(
'Null|num|String|bool|JSExtendableArray|NativeFloat32List|NativeInt32List|NativeUint32List|Framebuffer|Renderbuffer|Texture')
@Returns(
'Null|num|String|bool|JSExtendableArray|NativeFloat32List|NativeInt32List|NativeUint32List|Framebuffer|Renderbuffer|Texture')
Object? getParameter(int pname) native;
String? getProgramInfoLog(Program program) native;
@Creates('int|bool|Null')
@Returns('int|bool|Null')
Object? getProgramParameter(Program program, int pname) native;
@Creates('int|Null')
@Returns('int|Null')
Object? getRenderbufferParameter(int target, int pname) native;
String? getShaderInfoLog(Shader shader) native;
@Creates('int|bool|Null')
@Returns('int|bool|Null')
Object? getShaderParameter(Shader shader, int pname) native;
ShaderPrecisionFormat getShaderPrecisionFormat(
int shadertype, int precisiontype) native;
String? getShaderSource(Shader shader) native;
List<String>? getSupportedExtensions() native;
@Creates('int|Null')
@Returns('int|Null')
Object? getTexParameter(int target, int pname) native;
@Creates(
'Null|num|String|bool|JSExtendableArray|NativeFloat32List|NativeInt32List|NativeUint32List')
@Returns(
'Null|num|String|bool|JSExtendableArray|NativeFloat32List|NativeInt32List|NativeUint32List')
Object? getUniform(Program program, UniformLocation location) native;
UniformLocation getUniformLocation(Program program, String name) native;
@Creates('Null|num|bool|NativeFloat32List|Buffer')
@Returns('Null|num|bool|NativeFloat32List|Buffer')
Object? getVertexAttrib(int index, int pname) native;
int getVertexAttribOffset(int index, int pname) native;
void hint(int target, int mode) native;
bool isBuffer(Buffer? buffer) native;
bool isContextLost() native;
bool isEnabled(int cap) native;
bool isFramebuffer(Framebuffer? framebuffer) native;
bool isProgram(Program? program) native;
bool isRenderbuffer(Renderbuffer? renderbuffer) native;
bool isShader(Shader? shader) native;
bool isTexture(Texture? texture) native;
void lineWidth(num width) native;
void linkProgram(Program program) native;
void pixelStorei(int pname, int param) native;
void polygonOffset(num factor, num units) native;
@JSName('readPixels')
void _readPixels(int x, int y, int width, int height, int format, int type,
TypedData? pixels) native;
void renderbufferStorage(
int target, int internalformat, int width, int height) native;
void sampleCoverage(num value, bool invert) native;
void scissor(int x, int y, int width, int height) native;
void shaderSource(Shader shader, String string) native;
void stencilFunc(int func, int ref, int mask) native;
void stencilFuncSeparate(int face, int func, int ref, int mask) native;
void stencilMask(int mask) native;
void stencilMaskSeparate(int face, int mask) native;
void stencilOp(int fail, int zfail, int zpass) native;
void stencilOpSeparate(int face, int fail, int zfail, int zpass) native;
void texImage2D(
int target,
int level,
int internalformat,
int format_OR_width,
int height_OR_type,
bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video,
[int? format,
int? type,
TypedData? pixels]) {
if (type != null &&
format != null &&
(bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video is int)) {
_texImage2D_1(
target,
level,
internalformat,
format_OR_width,
height_OR_type,
bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video,
format,
type,
pixels);
return;
}
if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video is ImageData) &&
format == null &&
type == null &&
pixels == null) {
var pixels_1 = convertDartToNative_ImageData(
bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
_texImage2D_2(target, level, internalformat, format_OR_width,
height_OR_type, pixels_1);
return;
}
if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video
is ImageElement) &&
format == null &&
type == null &&
pixels == null) {
_texImage2D_3(
target,
level,
internalformat,
format_OR_width,
height_OR_type,
bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video
is CanvasElement) &&
format == null &&
type == null &&
pixels == null) {
_texImage2D_4(
target,
level,
internalformat,
format_OR_width,
height_OR_type,
bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video
is VideoElement) &&
format == null &&
type == null &&
pixels == null) {
_texImage2D_5(
target,
level,
internalformat,
format_OR_width,
height_OR_type,
bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video
is ImageBitmap) &&
format == null &&
type == null &&
pixels == null) {
_texImage2D_6(
target,
level,
internalformat,
format_OR_width,
height_OR_type,
bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@JSName('texImage2D')
void _texImage2D_1(target, level, internalformat, width, height, int border,
format, type, TypedData? pixels) native;
@JSName('texImage2D')
void _texImage2D_2(target, level, internalformat, format, type, pixels)
native;
@JSName('texImage2D')
void _texImage2D_3(
target, level, internalformat, format, type, ImageElement image) native;
@JSName('texImage2D')
void _texImage2D_4(
target, level, internalformat, format, type, CanvasElement canvas) native;
@JSName('texImage2D')
void _texImage2D_5(
target, level, internalformat, format, type, VideoElement video) native;
@JSName('texImage2D')
void _texImage2D_6(
target, level, internalformat, format, type, ImageBitmap bitmap) native;
void texParameterf(int target, int pname, num param) native;
void texParameteri(int target, int pname, int param) native;
void texSubImage2D(
int target,
int level,
int xoffset,
int yoffset,
int format_OR_width,
int height_OR_type,
bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video,
[int? type,
TypedData? pixels]) {
if (type != null &&
(bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video is int)) {
_texSubImage2D_1(
target,
level,
xoffset,
yoffset,
format_OR_width,
height_OR_type,
bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video,
type,
pixels);
return;
}
if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video is ImageData) &&
type == null &&
pixels == null) {
var pixels_1 = convertDartToNative_ImageData(
bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
_texSubImage2D_2(target, level, xoffset, yoffset, format_OR_width,
height_OR_type, pixels_1);
return;
}
if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video
is ImageElement) &&
type == null &&
pixels == null) {
_texSubImage2D_3(
target,
level,
xoffset,
yoffset,
format_OR_width,
height_OR_type,
bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video
is CanvasElement) &&
type == null &&
pixels == null) {
_texSubImage2D_4(
target,
level,
xoffset,
yoffset,
format_OR_width,
height_OR_type,
bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video
is VideoElement) &&
type == null &&
pixels == null) {
_texSubImage2D_5(
target,
level,
xoffset,
yoffset,
format_OR_width,
height_OR_type,
bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video
is ImageBitmap) &&
type == null &&
pixels == null) {
_texSubImage2D_6(
target,
level,
xoffset,
yoffset,
format_OR_width,
height_OR_type,
bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@JSName('texSubImage2D')
void _texSubImage2D_1(target, level, xoffset, yoffset, width, height,
int format, type, TypedData? pixels) native;
@JSName('texSubImage2D')
void _texSubImage2D_2(target, level, xoffset, yoffset, format, type, pixels)
native;
@JSName('texSubImage2D')
void _texSubImage2D_3(
target, level, xoffset, yoffset, format, type, ImageElement image) native;
@JSName('texSubImage2D')
void _texSubImage2D_4(target, level, xoffset, yoffset, format, type,
CanvasElement canvas) native;
@JSName('texSubImage2D')
void _texSubImage2D_5(
target, level, xoffset, yoffset, format, type, VideoElement video) native;
@JSName('texSubImage2D')
void _texSubImage2D_6(
target, level, xoffset, yoffset, format, type, ImageBitmap bitmap) native;
void uniform1f(UniformLocation? location, num x) native;
void uniform1fv(UniformLocation? location, v) native;
void uniform1i(UniformLocation? location, int x) native;
void uniform1iv(UniformLocation? location, v) native;
void uniform2f(UniformLocation? location, num x, num y) native;
void uniform2fv(UniformLocation? location, v) native;
void uniform2i(UniformLocation? location, int x, int y) native;
void uniform2iv(UniformLocation? location, v) native;
void uniform3f(UniformLocation? location, num x, num y, num z) native;
void uniform3fv(UniformLocation? location, v) native;
void uniform3i(UniformLocation? location, int x, int y, int z) native;
void uniform3iv(UniformLocation? location, v) native;
void uniform4f(UniformLocation? location, num x, num y, num z, num w) native;
void uniform4fv(UniformLocation? location, v) native;
void uniform4i(UniformLocation? location, int x, int y, int z, int w) native;
void uniform4iv(UniformLocation? location, v) native;
void uniformMatrix2fv(UniformLocation? location, bool transpose, array)
native;
void uniformMatrix3fv(UniformLocation? location, bool transpose, array)
native;
void uniformMatrix4fv(UniformLocation? location, bool transpose, array)
native;
void useProgram(Program? program) native;
void validateProgram(Program program) native;
void vertexAttrib1f(int indx, num x) native;
void vertexAttrib1fv(int indx, values) native;
void vertexAttrib2f(int indx, num x, num y) native;
void vertexAttrib2fv(int indx, values) native;
void vertexAttrib3f(int indx, num x, num y, num z) native;
void vertexAttrib3fv(int indx, values) native;
void vertexAttrib4f(int indx, num x, num y, num z, num w) native;
void vertexAttrib4fv(int indx, values) native;
void vertexAttribPointer(int indx, int size, int type, bool normalized,
int stride, int offset) native;
void viewport(int x, int y, int width, int height) native;
void readPixels(int x, int y, int width, int height, int format, int type,
TypedData? pixels) {
_readPixels(x, y, width, height, format, type, pixels);
}
/**
* Sets the currently bound texture to [data].
*
* [data] can be either an [ImageElement], a
* [CanvasElement], a [VideoElement], [TypedData] or an [ImageData] object.
*
* This is deprecated in favor of [texImage2D].
*/
@Deprecated("Use texImage2D")
void texImage2DUntyped(int targetTexture, int levelOfDetail,
int internalFormat, int format, int type, data) {
texImage2D(
targetTexture, levelOfDetail, internalFormat, format, type, data);
}
/**
* Sets the currently bound texture to [data].
*
* This is deprecated in favour of [texImage2D].
*/
@Deprecated("Use texImage2D")
void texImage2DTyped(int targetTexture, int levelOfDetail, int internalFormat,
int width, int height, int border, int format, int type, TypedData data) {
texImage2D(targetTexture, levelOfDetail, internalFormat, width, height,
border, format, type, data);
}
/**
* Updates a sub-rectangle of the currently bound texture to [data].
*
* [data] can be either an [ImageElement], a
* [CanvasElement], a [VideoElement], [TypedData] or an [ImageData] object.
*
*/
@Deprecated("Use texSubImage2D")
void texSubImage2DUntyped(int targetTexture, int levelOfDetail, int xOffset,
int yOffset, int format, int type, data) {
texSubImage2D(
targetTexture, levelOfDetail, xOffset, yOffset, format, type, data);
}
/**
* Updates a sub-rectangle of the currently bound texture to [data].
*/
@Deprecated("Use texSubImage2D")
void texSubImage2DTyped(
int targetTexture,
int levelOfDetail,
int xOffset,
int yOffset,
int width,
int height,
int border,
int format,
int type,
TypedData data) {
texSubImage2D(targetTexture, levelOfDetail, xOffset, yOffset, width, height,
format, type, data);
}
/**
* Set the bufferData to [data].
*/
@Deprecated("Use bufferData")
void bufferDataTyped(int target, TypedData data, int usage) {
bufferData(target, data, usage);
}
/**
* Set the bufferSubData to [data].
*/
@Deprecated("Use bufferSubData")
void bufferSubDataTyped(int target, int offset, TypedData data) {
bufferSubData(target, offset, data);
}
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGL2RenderingContext")
class RenderingContext2 extends JavaScriptObject
implements _WebGL2RenderingContextBase, _WebGLRenderingContextBase {
// To suppress missing implicit constructor warnings.
factory RenderingContext2._() {
throw new UnsupportedError("Not supported");
}
Canvas? get canvas native;
// From WebGL2RenderingContextBase
void beginQuery(int target, Query query) native;
void beginTransformFeedback(int primitiveMode) native;
void bindBufferBase(int target, int index, Buffer? buffer) native;
void bindBufferRange(
int target, int index, Buffer? buffer, int offset, int size) native;
void bindSampler(int unit, Sampler? sampler) native;
void bindTransformFeedback(int target, TransformFeedback? feedback) native;
void bindVertexArray(VertexArrayObject? vertexArray) native;
void blitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0,
int dstY0, int dstX1, int dstY1, int mask, int filter) native;
@JSName('bufferData')
void bufferData2(int target, TypedData srcData, int usage, int srcOffset,
[int? length]) native;
@JSName('bufferSubData')
void bufferSubData2(
int target, int dstByteOffset, TypedData srcData, int srcOffset,
[int? length]) native;
void clearBufferfi(int buffer, int drawbuffer, num depth, int stencil) native;
void clearBufferfv(int buffer, int drawbuffer, value, [int? srcOffset])
native;
void clearBufferiv(int buffer, int drawbuffer, value, [int? srcOffset])
native;
void clearBufferuiv(int buffer, int drawbuffer, value, [int? srcOffset])
native;
int clientWaitSync(Sync sync, int flags, int timeout) native;
@JSName('compressedTexImage2D')
void compressedTexImage2D2(int target, int level, int internalformat,
int width, int height, int border, TypedData data, int srcOffset,
[int? srcLengthOverride]) native;
@JSName('compressedTexImage2D')
void compressedTexImage2D3(int target, int level, int internalformat,
int width, int height, int border, int imageSize, int offset) native;
void compressedTexImage3D(int target, int level, int internalformat,
int width, int height, int depth, int border, TypedData data,
[int? srcOffset, int? srcLengthOverride]) native;
@JSName('compressedTexImage3D')
void compressedTexImage3D2(
int target,
int level,
int internalformat,
int width,
int height,
int depth,
int border,
int imageSize,
int offset) native;
@JSName('compressedTexSubImage2D')
void compressedTexSubImage2D2(int target, int level, int xoffset, int yoffset,
int width, int height, int format, TypedData data, int srcOffset,
[int? srcLengthOverride]) native;
@JSName('compressedTexSubImage2D')
void compressedTexSubImage2D3(int target, int level, int xoffset, int yoffset,
int width, int height, int format, int imageSize, int offset) native;
void compressedTexSubImage3D(int target, int level, int xoffset, int yoffset,
int zoffset, int width, int height, int depth, int format, TypedData data,
[int? srcOffset, int? srcLengthOverride]) native;
@JSName('compressedTexSubImage3D')
void compressedTexSubImage3D2(
int target,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int imageSize,
int offset) native;
void copyBufferSubData(int readTarget, int writeTarget, int readOffset,
int writeOffset, int size) native;
void copyTexSubImage3D(int target, int level, int xoffset, int yoffset,
int zoffset, int x, int y, int width, int height) native;
Query? createQuery() native;
Sampler? createSampler() native;
TransformFeedback? createTransformFeedback() native;
VertexArrayObject? createVertexArray() native;
void deleteQuery(Query? query) native;
void deleteSampler(Sampler? sampler) native;
void deleteSync(Sync? sync) native;
void deleteTransformFeedback(TransformFeedback? feedback) native;
void deleteVertexArray(VertexArrayObject? vertexArray) native;
void drawArraysInstanced(int mode, int first, int count, int instanceCount)
native;
void drawBuffers(List<int> buffers) native;
void drawElementsInstanced(
int mode, int count, int type, int offset, int instanceCount) native;
void drawRangeElements(
int mode, int start, int end, int count, int type, int offset) native;
void endQuery(int target) native;
void endTransformFeedback() native;
Sync? fenceSync(int condition, int flags) native;
void framebufferTextureLayer(int target, int attachment, Texture? texture,
int level, int layer) native;
String? getActiveUniformBlockName(Program program, int uniformBlockIndex)
native;
Object? getActiveUniformBlockParameter(
Program program, int uniformBlockIndex, int pname) native;
Object? getActiveUniforms(
Program program, List<int> uniformIndices, int pname) native;
void getBufferSubData(int target, int srcByteOffset, TypedData dstData,
[int? dstOffset, int? length]) native;
int getFragDataLocation(Program program, String name) native;
Object? getIndexedParameter(int target, int index) native;
Object? getInternalformatParameter(int target, int internalformat, int pname)
native;
Object? getQuery(int target, int pname) native;
Object? getQueryParameter(Query query, int pname) native;
Object? getSamplerParameter(Sampler sampler, int pname) native;
Object? getSyncParameter(Sync sync, int pname) native;
ActiveInfo? getTransformFeedbackVarying(Program program, int index) native;
int getUniformBlockIndex(Program program, String uniformBlockName) native;
List<int>? getUniformIndices(Program program, List<String> uniformNames) {
List uniformNames_1 = convertDartToNative_StringArray(uniformNames);
return _getUniformIndices_1(program, uniformNames_1);
}
@JSName('getUniformIndices')
List<int>? _getUniformIndices_1(Program program, List uniformNames) native;
void invalidateFramebuffer(int target, List<int> attachments) native;
void invalidateSubFramebuffer(int target, List<int> attachments, int x, int y,
int width, int height) native;
bool isQuery(Query? query) native;
bool isSampler(Sampler? sampler) native;
bool isSync(Sync? sync) native;
bool isTransformFeedback(TransformFeedback? feedback) native;
bool isVertexArray(VertexArrayObject? vertexArray) native;
void pauseTransformFeedback() native;
void readBuffer(int mode) native;
@JSName('readPixels')
void readPixels2(int x, int y, int width, int height, int format, int type,
dstData_OR_offset,
[int? offset]) native;
void renderbufferStorageMultisample(int target, int samples,
int internalformat, int width, int height) native;
void resumeTransformFeedback() native;
void samplerParameterf(Sampler sampler, int pname, num param) native;
void samplerParameteri(Sampler sampler, int pname, int param) native;
void texImage2D2(
int target,
int level,
int internalformat,
int width,
int height,
int border,
int format,
int type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video,
[int? srcOffset]) {
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
is int) &&
srcOffset == null) {
_texImage2D2_1(
target,
level,
internalformat,
width,
height,
border,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
is ImageData) &&
srcOffset == null) {
var data_1 = convertDartToNative_ImageData(
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
_texImage2D2_2(target, level, internalformat, width, height, border,
format, type, data_1);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
is ImageElement) &&
srcOffset == null) {
_texImage2D2_3(
target,
level,
internalformat,
width,
height,
border,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
is CanvasElement) &&
srcOffset == null) {
_texImage2D2_4(
target,
level,
internalformat,
width,
height,
border,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
is VideoElement) &&
srcOffset == null) {
_texImage2D2_5(
target,
level,
internalformat,
width,
height,
border,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
is ImageBitmap) &&
srcOffset == null) {
_texImage2D2_6(
target,
level,
internalformat,
width,
height,
border,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
return;
}
if (srcOffset != null &&
(bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
is TypedData)) {
_texImage2D2_7(
target,
level,
internalformat,
width,
height,
border,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video,
srcOffset);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@JSName('texImage2D')
void _texImage2D2_1(target, level, internalformat, width, height, border,
format, type, int offset) native;
@JSName('texImage2D')
void _texImage2D2_2(target, level, internalformat, width, height, border,
format, type, data) native;
@JSName('texImage2D')
void _texImage2D2_3(target, level, internalformat, width, height, border,
format, type, ImageElement image) native;
@JSName('texImage2D')
void _texImage2D2_4(target, level, internalformat, width, height, border,
format, type, CanvasElement canvas) native;
@JSName('texImage2D')
void _texImage2D2_5(target, level, internalformat, width, height, border,
format, type, VideoElement video) native;
@JSName('texImage2D')
void _texImage2D2_6(target, level, internalformat, width, height, border,
format, type, ImageBitmap bitmap) native;
@JSName('texImage2D')
void _texImage2D2_7(target, level, internalformat, width, height, border,
format, type, TypedData srcData, srcOffset) native;
void texImage3D(
int target,
int level,
int internalformat,
int width,
int height,
int depth,
int border,
int format,
int type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video,
[int? srcOffset]) {
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
is int) &&
srcOffset == null) {
_texImage3D_1(
target,
level,
internalformat,
width,
height,
depth,
border,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
is ImageData) &&
srcOffset == null) {
var data_1 = convertDartToNative_ImageData(
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
_texImage3D_2(target, level, internalformat, width, height, depth, border,
format, type, data_1);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
is ImageElement) &&
srcOffset == null) {
_texImage3D_3(
target,
level,
internalformat,
width,
height,
depth,
border,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
is CanvasElement) &&
srcOffset == null) {
_texImage3D_4(
target,
level,
internalformat,
width,
height,
depth,
border,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
is VideoElement) &&
srcOffset == null) {
_texImage3D_5(
target,
level,
internalformat,
width,
height,
depth,
border,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
is ImageBitmap) &&
srcOffset == null) {
_texImage3D_6(
target,
level,
internalformat,
width,
height,
depth,
border,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
is TypedData ||
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video ==
null) &&
srcOffset == null) {
_texImage3D_7(
target,
level,
internalformat,
width,
height,
depth,
border,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
return;
}
if (srcOffset != null &&
(bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
is TypedData)) {
_texImage3D_8(
target,
level,
internalformat,
width,
height,
depth,
border,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video,
srcOffset);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@JSName('texImage3D')
void _texImage3D_1(target, level, internalformat, width, height, depth,
border, format, type, int offset) native;
@JSName('texImage3D')
void _texImage3D_2(target, level, internalformat, width, height, depth,
border, format, type, data) native;
@JSName('texImage3D')
void _texImage3D_3(target, level, internalformat, width, height, depth,
border, format, type, ImageElement image) native;
@JSName('texImage3D')
void _texImage3D_4(target, level, internalformat, width, height, depth,
border, format, type, CanvasElement canvas) native;
@JSName('texImage3D')
void _texImage3D_5(target, level, internalformat, width, height, depth,
border, format, type, VideoElement video) native;
@JSName('texImage3D')
void _texImage3D_6(target, level, internalformat, width, height, depth,
border, format, type, ImageBitmap bitmap) native;
@JSName('texImage3D')
void _texImage3D_7(target, level, internalformat, width, height, depth,
border, format, type, TypedData? pixels) native;
@JSName('texImage3D')
void _texImage3D_8(target, level, internalformat, width, height, depth,
border, format, type, TypedData pixels, srcOffset) native;
void texStorage2D(
int target, int levels, int internalformat, int width, int height) native;
void texStorage3D(int target, int levels, int internalformat, int width,
int height, int depth) native;
void texSubImage2D2(
int target,
int level,
int xoffset,
int yoffset,
int width,
int height,
int format,
int type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video,
[int? srcOffset]) {
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
is int) &&
srcOffset == null) {
_texSubImage2D2_1(
target,
level,
xoffset,
yoffset,
width,
height,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
is ImageData) &&
srcOffset == null) {
var data_1 = convertDartToNative_ImageData(
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
_texSubImage2D2_2(
target, level, xoffset, yoffset, width, height, format, type, data_1);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
is ImageElement) &&
srcOffset == null) {
_texSubImage2D2_3(
target,
level,
xoffset,
yoffset,
width,
height,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
is CanvasElement) &&
srcOffset == null) {
_texSubImage2D2_4(
target,
level,
xoffset,
yoffset,
width,
height,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
is VideoElement) &&
srcOffset == null) {
_texSubImage2D2_5(
target,
level,
xoffset,
yoffset,
width,
height,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
is ImageBitmap) &&
srcOffset == null) {
_texSubImage2D2_6(
target,
level,
xoffset,
yoffset,
width,
height,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video);
return;
}
if (srcOffset != null &&
(bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video
is TypedData)) {
_texSubImage2D2_7(
target,
level,
xoffset,
yoffset,
width,
height,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_srcData_OR_video,
srcOffset);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@JSName('texSubImage2D')
void _texSubImage2D2_1(target, level, xoffset, yoffset, width, height, format,
type, int offset) native;
@JSName('texSubImage2D')
void _texSubImage2D2_2(target, level, xoffset, yoffset, width, height, format,
type, data) native;
@JSName('texSubImage2D')
void _texSubImage2D2_3(target, level, xoffset, yoffset, width, height, format,
type, ImageElement image) native;
@JSName('texSubImage2D')
void _texSubImage2D2_4(target, level, xoffset, yoffset, width, height, format,
type, CanvasElement canvas) native;
@JSName('texSubImage2D')
void _texSubImage2D2_5(target, level, xoffset, yoffset, width, height, format,
type, VideoElement video) native;
@JSName('texSubImage2D')
void _texSubImage2D2_6(target, level, xoffset, yoffset, width, height, format,
type, ImageBitmap bitmap) native;
@JSName('texSubImage2D')
void _texSubImage2D2_7(target, level, xoffset, yoffset, width, height, format,
type, TypedData srcData, srcOffset) native;
void texSubImage3D(
int target,
int level,
int xoffset,
int yoffset,
int zoffset,
int width,
int height,
int depth,
int format,
int type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video,
[int? srcOffset]) {
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
is int) &&
srcOffset == null) {
_texSubImage3D_1(
target,
level,
xoffset,
yoffset,
zoffset,
width,
height,
depth,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
is ImageData) &&
srcOffset == null) {
var data_1 = convertDartToNative_ImageData(
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
_texSubImage3D_2(target, level, xoffset, yoffset, zoffset, width, height,
depth, format, type, data_1);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
is ImageElement) &&
srcOffset == null) {
_texSubImage3D_3(
target,
level,
xoffset,
yoffset,
zoffset,
width,
height,
depth,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
is CanvasElement) &&
srcOffset == null) {
_texSubImage3D_4(
target,
level,
xoffset,
yoffset,
zoffset,
width,
height,
depth,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
is VideoElement) &&
srcOffset == null) {
_texSubImage3D_5(
target,
level,
xoffset,
yoffset,
zoffset,
width,
height,
depth,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
is ImageBitmap) &&
srcOffset == null) {
_texSubImage3D_6(
target,
level,
xoffset,
yoffset,
zoffset,
width,
height,
depth,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
is TypedData) &&
srcOffset == null) {
_texSubImage3D_7(
target,
level,
xoffset,
yoffset,
zoffset,
width,
height,
depth,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video);
return;
}
if (srcOffset != null &&
(bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video
is TypedData)) {
_texSubImage3D_8(
target,
level,
xoffset,
yoffset,
zoffset,
width,
height,
depth,
format,
type,
bitmap_OR_canvas_OR_data_OR_image_OR_offset_OR_pixels_OR_video,
srcOffset);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@JSName('texSubImage3D')
void _texSubImage3D_1(target, level, xoffset, yoffset, zoffset, width, height,
depth, format, type, int offset) native;
@JSName('texSubImage3D')
void _texSubImage3D_2(target, level, xoffset, yoffset, zoffset, width, height,
depth, format, type, data) native;
@JSName('texSubImage3D')
void _texSubImage3D_3(target, level, xoffset, yoffset, zoffset, width, height,
depth, format, type, ImageElement image) native;
@JSName('texSubImage3D')
void _texSubImage3D_4(target, level, xoffset, yoffset, zoffset, width, height,
depth, format, type, CanvasElement canvas) native;
@JSName('texSubImage3D')
void _texSubImage3D_5(target, level, xoffset, yoffset, zoffset, width, height,
depth, format, type, VideoElement video) native;
@JSName('texSubImage3D')
void _texSubImage3D_6(target, level, xoffset, yoffset, zoffset, width, height,
depth, format, type, ImageBitmap bitmap) native;
@JSName('texSubImage3D')
void _texSubImage3D_7(target, level, xoffset, yoffset, zoffset, width, height,
depth, format, type, TypedData pixels) native;
@JSName('texSubImage3D')
void _texSubImage3D_8(target, level, xoffset, yoffset, zoffset, width, height,
depth, format, type, TypedData pixels, srcOffset) native;
void transformFeedbackVaryings(
Program program, List<String> varyings, int bufferMode) {
List varyings_1 = convertDartToNative_StringArray(varyings);
_transformFeedbackVaryings_1(program, varyings_1, bufferMode);
return;
}
@JSName('transformFeedbackVaryings')
void _transformFeedbackVaryings_1(Program program, List varyings, bufferMode)
native;
@JSName('uniform1fv')
void uniform1fv2(UniformLocation? location, v, int srcOffset,
[int? srcLength]) native;
@JSName('uniform1iv')
void uniform1iv2(UniformLocation? location, v, int srcOffset,
[int? srcLength]) native;
void uniform1ui(UniformLocation? location, int v0) native;
void uniform1uiv(UniformLocation? location, v,
[int? srcOffset, int? srcLength]) native;
@JSName('uniform2fv')
void uniform2fv2(UniformLocation? location, v, int srcOffset,
[int? srcLength]) native;
@JSName('uniform2iv')
void uniform2iv2(UniformLocation? location, v, int srcOffset,
[int? srcLength]) native;
void uniform2ui(UniformLocation? location, int v0, int v1) native;
void uniform2uiv(UniformLocation? location, v,
[int? srcOffset, int? srcLength]) native;
@JSName('uniform3fv')
void uniform3fv2(UniformLocation? location, v, int srcOffset,
[int? srcLength]) native;
@JSName('uniform3iv')
void uniform3iv2(UniformLocation? location, v, int srcOffset,
[int? srcLength]) native;
void uniform3ui(UniformLocation? location, int v0, int v1, int v2) native;
void uniform3uiv(UniformLocation? location, v,
[int? srcOffset, int? srcLength]) native;
@JSName('uniform4fv')
void uniform4fv2(UniformLocation? location, v, int srcOffset,
[int? srcLength]) native;
@JSName('uniform4iv')
void uniform4iv2(UniformLocation? location, v, int srcOffset,
[int? srcLength]) native;
void uniform4ui(UniformLocation? location, int v0, int v1, int v2, int v3)
native;
void uniform4uiv(UniformLocation? location, v,
[int? srcOffset, int? srcLength]) native;
void uniformBlockBinding(
Program program, int uniformBlockIndex, int uniformBlockBinding) native;
@JSName('uniformMatrix2fv')
void uniformMatrix2fv2(
UniformLocation? location, bool transpose, array, int srcOffset,
[int? srcLength]) native;
void uniformMatrix2x3fv(UniformLocation? location, bool transpose, value,
[int? srcOffset, int? srcLength]) native;
void uniformMatrix2x4fv(UniformLocation? location, bool transpose, value,
[int? srcOffset, int? srcLength]) native;
@JSName('uniformMatrix3fv')
void uniformMatrix3fv2(
UniformLocation? location, bool transpose, array, int srcOffset,
[int? srcLength]) native;
void uniformMatrix3x2fv(UniformLocation? location, bool transpose, value,
[int? srcOffset, int? srcLength]) native;
void uniformMatrix3x4fv(UniformLocation? location, bool transpose, value,
[int? srcOffset, int? srcLength]) native;
@JSName('uniformMatrix4fv')
void uniformMatrix4fv2(
UniformLocation? location, bool transpose, array, int srcOffset,
[int? srcLength]) native;
void uniformMatrix4x2fv(UniformLocation? location, bool transpose, value,
[int? srcOffset, int? srcLength]) native;
void uniformMatrix4x3fv(UniformLocation? location, bool transpose, value,
[int? srcOffset, int? srcLength]) native;
void vertexAttribDivisor(int index, int divisor) native;
void vertexAttribI4i(int index, int x, int y, int z, int w) native;
void vertexAttribI4iv(int index, v) native;
void vertexAttribI4ui(int index, int x, int y, int z, int w) native;
void vertexAttribI4uiv(int index, v) native;
void vertexAttribIPointer(
int index, int size, int type, int stride, int offset) native;
void waitSync(Sync sync, int flags, int timeout) native;
// From WebGLRenderingContextBase
int? get drawingBufferHeight native;
int? get drawingBufferWidth native;
void activeTexture(int texture) native;
void attachShader(Program program, Shader shader) native;
void bindAttribLocation(Program program, int index, String name) native;
void bindBuffer(int target, Buffer? buffer) native;
void bindFramebuffer(int target, Framebuffer? framebuffer) native;
void bindRenderbuffer(int target, Renderbuffer? renderbuffer) native;
void bindTexture(int target, Texture? texture) native;
void blendColor(num red, num green, num blue, num alpha) native;
void blendEquation(int mode) native;
void blendEquationSeparate(int modeRGB, int modeAlpha) native;
void blendFunc(int sfactor, int dfactor) native;
void blendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha)
native;
void bufferData(int target, data_OR_size, int usage) native;
void bufferSubData(int target, int offset, data) native;
int checkFramebufferStatus(int target) native;
void clear(int mask) native;
void clearColor(num red, num green, num blue, num alpha) native;
void clearDepth(num depth) native;
void clearStencil(int s) native;
void colorMask(bool red, bool green, bool blue, bool alpha) native;
Future commit() => promiseToFuture(JS("", "#.commit()", this));
void compileShader(Shader shader) native;
void compressedTexImage2D(int target, int level, int internalformat,
int width, int height, int border, TypedData data) native;
void compressedTexSubImage2D(int target, int level, int xoffset, int yoffset,
int width, int height, int format, TypedData data) native;
void copyTexImage2D(int target, int level, int internalformat, int x, int y,
int width, int height, int border) native;
void copyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x,
int y, int width, int height) native;
Buffer createBuffer() native;
Framebuffer createFramebuffer() native;
Program createProgram() native;
Renderbuffer createRenderbuffer() native;
Shader createShader(int type) native;
Texture createTexture() native;
void cullFace(int mode) native;
void deleteBuffer(Buffer? buffer) native;
void deleteFramebuffer(Framebuffer? framebuffer) native;
void deleteProgram(Program? program) native;
void deleteRenderbuffer(Renderbuffer? renderbuffer) native;
void deleteShader(Shader? shader) native;
void deleteTexture(Texture? texture) native;
void depthFunc(int func) native;
void depthMask(bool flag) native;
void depthRange(num zNear, num zFar) native;
void detachShader(Program program, Shader shader) native;
void disable(int cap) native;
void disableVertexAttribArray(int index) native;
void drawArrays(int mode, int first, int count) native;
void drawElements(int mode, int count, int type, int offset) native;
void enable(int cap) native;
void enableVertexAttribArray(int index) native;
void finish() native;
void flush() native;
void framebufferRenderbuffer(int target, int attachment,
int renderbuffertarget, Renderbuffer? renderbuffer) native;
void framebufferTexture2D(int target, int attachment, int textarget,
Texture? texture, int level) native;
void frontFace(int mode) native;
void generateMipmap(int target) native;
ActiveInfo getActiveAttrib(Program program, int index) native;
ActiveInfo getActiveUniform(Program program, int index) native;
List<Shader>? getAttachedShaders(Program program) native;
int getAttribLocation(Program program, String name) native;
Object? getBufferParameter(int target, int pname) native;
Map? getContextAttributes() {
return convertNativeToDart_Dictionary(_getContextAttributes_1());
}
@JSName('getContextAttributes')
_getContextAttributes_1() native;
int getError() native;
Object? getExtension(String name) native;
Object? getFramebufferAttachmentParameter(
int target, int attachment, int pname) native;
Object? getParameter(int pname) native;
String? getProgramInfoLog(Program program) native;
Object? getProgramParameter(Program program, int pname) native;
Object? getRenderbufferParameter(int target, int pname) native;
String? getShaderInfoLog(Shader shader) native;
Object? getShaderParameter(Shader shader, int pname) native;
ShaderPrecisionFormat getShaderPrecisionFormat(
int shadertype, int precisiontype) native;
String? getShaderSource(Shader shader) native;
List<String>? getSupportedExtensions() native;
Object? getTexParameter(int target, int pname) native;
Object? getUniform(Program program, UniformLocation location) native;
UniformLocation getUniformLocation(Program program, String name) native;
Object? getVertexAttrib(int index, int pname) native;
int getVertexAttribOffset(int index, int pname) native;
void hint(int target, int mode) native;
bool isBuffer(Buffer? buffer) native;
bool isContextLost() native;
bool isEnabled(int cap) native;
bool isFramebuffer(Framebuffer? framebuffer) native;
bool isProgram(Program? program) native;
bool isRenderbuffer(Renderbuffer? renderbuffer) native;
bool isShader(Shader? shader) native;
bool isTexture(Texture? texture) native;
void lineWidth(num width) native;
void linkProgram(Program program) native;
void pixelStorei(int pname, int param) native;
void polygonOffset(num factor, num units) native;
@JSName('readPixels')
void _readPixels(int x, int y, int width, int height, int format, int type,
TypedData? pixels) native;
void renderbufferStorage(
int target, int internalformat, int width, int height) native;
void sampleCoverage(num value, bool invert) native;
void scissor(int x, int y, int width, int height) native;
void shaderSource(Shader shader, String string) native;
void stencilFunc(int func, int ref, int mask) native;
void stencilFuncSeparate(int face, int func, int ref, int mask) native;
void stencilMask(int mask) native;
void stencilMaskSeparate(int face, int mask) native;
void stencilOp(int fail, int zfail, int zpass) native;
void stencilOpSeparate(int face, int fail, int zfail, int zpass) native;
void texImage2D(
int target,
int level,
int internalformat,
int format_OR_width,
int height_OR_type,
bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video,
[int? format,
int? type,
TypedData? pixels]) {
if (type != null &&
format != null &&
(bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video is int)) {
_texImage2D_1(
target,
level,
internalformat,
format_OR_width,
height_OR_type,
bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video,
format,
type,
pixels);
return;
}
if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video is ImageData) &&
format == null &&
type == null &&
pixels == null) {
var pixels_1 = convertDartToNative_ImageData(
bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
_texImage2D_2(target, level, internalformat, format_OR_width,
height_OR_type, pixels_1);
return;
}
if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video
is ImageElement) &&
format == null &&
type == null &&
pixels == null) {
_texImage2D_3(
target,
level,
internalformat,
format_OR_width,
height_OR_type,
bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video
is CanvasElement) &&
format == null &&
type == null &&
pixels == null) {
_texImage2D_4(
target,
level,
internalformat,
format_OR_width,
height_OR_type,
bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video
is VideoElement) &&
format == null &&
type == null &&
pixels == null) {
_texImage2D_5(
target,
level,
internalformat,
format_OR_width,
height_OR_type,
bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video
is ImageBitmap) &&
format == null &&
type == null &&
pixels == null) {
_texImage2D_6(
target,
level,
internalformat,
format_OR_width,
height_OR_type,
bitmap_OR_border_OR_canvas_OR_image_OR_pixels_OR_video);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@JSName('texImage2D')
void _texImage2D_1(target, level, internalformat, width, height, int border,
format, type, TypedData? pixels) native;
@JSName('texImage2D')
void _texImage2D_2(target, level, internalformat, format, type, pixels)
native;
@JSName('texImage2D')
void _texImage2D_3(
target, level, internalformat, format, type, ImageElement image) native;
@JSName('texImage2D')
void _texImage2D_4(
target, level, internalformat, format, type, CanvasElement canvas) native;
@JSName('texImage2D')
void _texImage2D_5(
target, level, internalformat, format, type, VideoElement video) native;
@JSName('texImage2D')
void _texImage2D_6(
target, level, internalformat, format, type, ImageBitmap bitmap) native;
void texParameterf(int target, int pname, num param) native;
void texParameteri(int target, int pname, int param) native;
void texSubImage2D(
int target,
int level,
int xoffset,
int yoffset,
int format_OR_width,
int height_OR_type,
bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video,
[int? type,
TypedData? pixels]) {
if (type != null &&
(bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video is int)) {
_texSubImage2D_1(
target,
level,
xoffset,
yoffset,
format_OR_width,
height_OR_type,
bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video,
type,
pixels);
return;
}
if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video is ImageData) &&
type == null &&
pixels == null) {
var pixels_1 = convertDartToNative_ImageData(
bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
_texSubImage2D_2(target, level, xoffset, yoffset, format_OR_width,
height_OR_type, pixels_1);
return;
}
if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video
is ImageElement) &&
type == null &&
pixels == null) {
_texSubImage2D_3(
target,
level,
xoffset,
yoffset,
format_OR_width,
height_OR_type,
bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video
is CanvasElement) &&
type == null &&
pixels == null) {
_texSubImage2D_4(
target,
level,
xoffset,
yoffset,
format_OR_width,
height_OR_type,
bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video
is VideoElement) &&
type == null &&
pixels == null) {
_texSubImage2D_5(
target,
level,
xoffset,
yoffset,
format_OR_width,
height_OR_type,
bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
return;
}
if ((bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video
is ImageBitmap) &&
type == null &&
pixels == null) {
_texSubImage2D_6(
target,
level,
xoffset,
yoffset,
format_OR_width,
height_OR_type,
bitmap_OR_canvas_OR_format_OR_image_OR_pixels_OR_video);
return;
}
throw new ArgumentError("Incorrect number or type of arguments");
}
@JSName('texSubImage2D')
void _texSubImage2D_1(target, level, xoffset, yoffset, width, height,
int format, type, TypedData? pixels) native;
@JSName('texSubImage2D')
void _texSubImage2D_2(target, level, xoffset, yoffset, format, type, pixels)
native;
@JSName('texSubImage2D')
void _texSubImage2D_3(
target, level, xoffset, yoffset, format, type, ImageElement image) native;
@JSName('texSubImage2D')
void _texSubImage2D_4(target, level, xoffset, yoffset, format, type,
CanvasElement canvas) native;
@JSName('texSubImage2D')
void _texSubImage2D_5(
target, level, xoffset, yoffset, format, type, VideoElement video) native;
@JSName('texSubImage2D')
void _texSubImage2D_6(
target, level, xoffset, yoffset, format, type, ImageBitmap bitmap) native;
void uniform1f(UniformLocation? location, num x) native;
void uniform1fv(UniformLocation? location, v) native;
void uniform1i(UniformLocation? location, int x) native;
void uniform1iv(UniformLocation? location, v) native;
void uniform2f(UniformLocation? location, num x, num y) native;
void uniform2fv(UniformLocation? location, v) native;
void uniform2i(UniformLocation? location, int x, int y) native;
void uniform2iv(UniformLocation? location, v) native;
void uniform3f(UniformLocation? location, num x, num y, num z) native;
void uniform3fv(UniformLocation? location, v) native;
void uniform3i(UniformLocation? location, int x, int y, int z) native;
void uniform3iv(UniformLocation? location, v) native;
void uniform4f(UniformLocation? location, num x, num y, num z, num w) native;
void uniform4fv(UniformLocation? location, v) native;
void uniform4i(UniformLocation? location, int x, int y, int z, int w) native;
void uniform4iv(UniformLocation? location, v) native;
void uniformMatrix2fv(UniformLocation? location, bool transpose, array)
native;
void uniformMatrix3fv(UniformLocation? location, bool transpose, array)
native;
void uniformMatrix4fv(UniformLocation? location, bool transpose, array)
native;
void useProgram(Program? program) native;
void validateProgram(Program program) native;
void vertexAttrib1f(int indx, num x) native;
void vertexAttrib1fv(int indx, values) native;
void vertexAttrib2f(int indx, num x, num y) native;
void vertexAttrib2fv(int indx, values) native;
void vertexAttrib3f(int indx, num x, num y, num z) native;
void vertexAttrib3fv(int indx, values) native;
void vertexAttrib4f(int indx, num x, num y, num z, num w) native;
void vertexAttrib4fv(int indx, values) native;
void vertexAttribPointer(int indx, int size, int type, bool normalized,
int stride, int offset) native;
void viewport(int x, int y, int width, int height) native;
void readPixels(int x, int y, int width, int height, int format, int type,
TypedData pixels) {
_readPixels(x, y, width, height, format, type, pixels);
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLSampler")
class Sampler extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory Sampler._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLShader")
class Shader extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory Shader._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLShaderPrecisionFormat")
class ShaderPrecisionFormat extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory ShaderPrecisionFormat._() {
throw new UnsupportedError("Not supported");
}
int get precision native;
int get rangeMax native;
int get rangeMin native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLSync")
class Sync extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory Sync._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLTexture")
class Texture extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory Texture._() {
throw new UnsupportedError("Not supported");
}
bool? get lastUploadedVideoFrameWasSkipped native;
int? get lastUploadedVideoHeight native;
num? get lastUploadedVideoTimestamp native;
int? get lastUploadedVideoWidth native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLTimerQueryEXT")
class TimerQueryExt extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory TimerQueryExt._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLTransformFeedback")
class TransformFeedback extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory TransformFeedback._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLUniformLocation")
class UniformLocation extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory UniformLocation._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLVertexArrayObject")
class VertexArrayObject extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory VertexArrayObject._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@Native("WebGLVertexArrayObjectOES")
class VertexArrayObjectOes extends JavaScriptObject {
// To suppress missing implicit constructor warnings.
factory VertexArrayObjectOes._() {
throw new UnsupportedError("Not supported");
}
}
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/// Amalgamation of the WebGL constants from the IDL interfaces in
/// WebGLRenderingContextBase, WebGL2RenderingContextBase, & WebGLDrawBuffers.
/// Because the RenderingContextBase interfaces are hidden they would be
/// replicated in more than one class (e.g., RenderingContext and
/// RenderingContext2) to prevent that duplication these 600+ constants are
/// defined in one abstract class (WebGL).
@Native("WebGL")
abstract class WebGL {
// To suppress missing implicit constructor warnings.
factory WebGL._() {
throw new UnsupportedError("Not supported");
}
static const int ACTIVE_ATTRIBUTES = 0x8B89;
static const int ACTIVE_TEXTURE = 0x84E0;
static const int ACTIVE_UNIFORMS = 0x8B86;
static const int ACTIVE_UNIFORM_BLOCKS = 0x8A36;
static const int ALIASED_LINE_WIDTH_RANGE = 0x846E;
static const int ALIASED_POINT_SIZE_RANGE = 0x846D;
static const int ALPHA = 0x1906;
static const int ALPHA_BITS = 0x0D55;
static const int ALREADY_SIGNALED = 0x911A;
static const int ALWAYS = 0x0207;
static const int ANY_SAMPLES_PASSED = 0x8C2F;
static const int ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A;
static const int ARRAY_BUFFER = 0x8892;
static const int ARRAY_BUFFER_BINDING = 0x8894;
static const int ATTACHED_SHADERS = 0x8B85;
static const int BACK = 0x0405;
static const int BLEND = 0x0BE2;
static const int BLEND_COLOR = 0x8005;
static const int BLEND_DST_ALPHA = 0x80CA;
static const int BLEND_DST_RGB = 0x80C8;
static const int BLEND_EQUATION = 0x8009;
static const int BLEND_EQUATION_ALPHA = 0x883D;
static const int BLEND_EQUATION_RGB = 0x8009;
static const int BLEND_SRC_ALPHA = 0x80CB;
static const int BLEND_SRC_RGB = 0x80C9;
static const int BLUE_BITS = 0x0D54;
static const int BOOL = 0x8B56;
static const int BOOL_VEC2 = 0x8B57;