RenderingContext#
Annotations: @SupportedBrowser.new(SupportedBrowser.CHROME), @SupportedBrowser.new(SupportedBrowser.FIREFOX),
@Unstable.new(), @Native.new("WebGLRenderingContext")
Implemented types
Properties#
canvas no setter override#
Implementation
CanvasElement get canvas native;
drawingBufferHeight no setter#
Implementation
int? get drawingBufferHeight native;
drawingBufferWidth no setter#
Implementation
int? get drawingBufferWidth native;
hashCode no setter inherited#
Inherited from Interceptor.
Implementation
int get hashCode => Primitives.objectHashCode(this);
runtimeType no setter inherited#
Inherited from Interceptor.
Implementation
Type get runtimeType =>
getRuntimeTypeOfInterceptorNotArray(getInterceptor(this), this);
Methods#
activeTexture()#
Implementation
void activeTexture(int texture) native;
attachShader()#
Implementation
void attachShader(Program program, Shader shader) native;
bindAttribLocation()#
Implementation
void bindAttribLocation(Program program, int index, String name) native;
bindBuffer()#
Implementation
void bindBuffer(int target, Buffer? buffer) native;
bindFramebuffer()#
Implementation
void bindFramebuffer(int target, Framebuffer? framebuffer) native;
bindRenderbuffer()#
Implementation
void bindRenderbuffer(int target, Renderbuffer? renderbuffer) native;
bindTexture()#
Implementation
void bindTexture(int target, Texture? texture) native;
blendColor()#
Implementation
void blendColor(num red, num green, num blue, num alpha) native;
blendEquation()#
Implementation
void blendEquation(int mode) native;
blendEquationSeparate()#
Implementation
void blendEquationSeparate(int modeRGB, int modeAlpha) native;
blendFunc()#
Implementation
void blendFunc(int sfactor, int dfactor) native;
blendFuncSeparate()#
Implementation
void blendFuncSeparate(
int srcRGB,
int dstRGB,
int srcAlpha,
int dstAlpha,
) native;
bufferData()#
Implementation
void bufferData(int target, data_OR_size, int usage) native;
deprecated bufferDataTyped()#
DEPRECATED
Use bufferData
Set the bufferData to data.
Implementation
@Deprecated("Use bufferData")
void bufferDataTyped(int target, TypedData data, int usage) {
bufferData(target, data, usage);
}
bufferSubData()#
Implementation
void bufferSubData(int target, int offset, data) native;
deprecated bufferSubDataTyped()#
DEPRECATED
Use bufferSubData
Set the bufferSubData to data.
Implementation
@Deprecated("Use bufferSubData")
void bufferSubDataTyped(int target, int offset, TypedData data) {
bufferSubData(target, offset, data);
}
checkFramebufferStatus()#
Implementation
int checkFramebufferStatus(int target) native;
clear()#
Implementation
void clear(int mask) native;
clearColor()#
Implementation
void clearColor(num red, num green, num blue, num alpha) native;
clearDepth()#
Implementation
void clearDepth(num depth) native;
clearStencil()#
Implementation
void clearStencil(int s) native;
colorMask()#
Implementation
void colorMask(bool red, bool green, bool blue, bool alpha) native;
commit()#
Implementation
Future commit() => promiseToFuture(JS("", "#.commit()", this));
compileShader()#
Implementation
void compileShader(Shader shader) native;
compressedTexImage2D()#
Implementation
void compressedTexImage2D(
int target,
int level,
int internalformat,
int width,
int height,
int border,
TypedData data,
) native;
compressedTexSubImage2D()#
Implementation
void compressedTexSubImage2D(
int target,
int level,
int xoffset,
int yoffset,
int width,
int height,
int format,
TypedData data,
) native;
copyTexImage2D()#
Implementation
void copyTexImage2D(
int target,
int level,
int internalformat,
int x,
int y,
int width,
int height,
int border,
) native;
copyTexSubImage2D()#
Implementation
void copyTexSubImage2D(
int target,
int level,
int xoffset,
int yoffset,
int x,
int y,
int width,
int height,
) native;
createBuffer()#
Implementation
Buffer createBuffer() native;
createFramebuffer()#
Implementation
Framebuffer createFramebuffer() native;
createProgram()#
Implementation
Program createProgram() native;
createRenderbuffer()#
Implementation
Renderbuffer createRenderbuffer() native;
createShader()#
Implementation
Shader createShader(int type) native;
createTexture()#
Implementation
Texture createTexture() native;
cullFace()#
Implementation
void cullFace(int mode) native;
deleteBuffer()#
Implementation
void deleteBuffer(Buffer? buffer) native;
deleteFramebuffer()#
Implementation
void deleteFramebuffer(Framebuffer? framebuffer) native;
deleteProgram()#
Implementation
void deleteProgram(Program? program) native;
deleteRenderbuffer()#
Implementation
void deleteRenderbuffer(Renderbuffer? renderbuffer) native;
deleteShader()#
Implementation
void deleteShader(Shader? shader) native;
deleteTexture()#
Implementation
void deleteTexture(Texture? texture) native;
depthFunc()#
Implementation
void depthFunc(int func) native;
depthMask()#
Implementation
void depthMask(bool flag) native;
depthRange()#
Implementation
void depthRange(num zNear, num zFar) native;
detachShader()#
Implementation
void detachShader(Program program, Shader shader) native;
disable()#
Implementation
void disable(int cap) native;
disableVertexAttribArray()#
Implementation
void disableVertexAttribArray(int index) native;
drawArrays()#
Implementation
void drawArrays(int mode, int first, int count) native;
drawElements()#
Implementation
void drawElements(int mode, int count, int type, int offset) native;
enable()#
Implementation
void enable(int cap) native;
enableVertexAttribArray()#
Implementation
void enableVertexAttribArray(int index) native;
finish()#
Implementation
void finish() native;
flush()#
Implementation
void flush() native;
framebufferRenderbuffer()#
Implementation
void framebufferRenderbuffer(
int target,
int attachment,
int renderbuffertarget,
Renderbuffer? renderbuffer,
) native;
framebufferTexture2D()#
Implementation
void framebufferTexture2D(
int target,
int attachment,
int textarget,
Texture? texture,
int level,
) native;
frontFace()#
Implementation
void frontFace(int mode) native;
generateMipmap()#
Implementation
void generateMipmap(int target) native;
getActiveAttrib()#
Implementation
ActiveInfo getActiveAttrib(Program program, int index) native;
getActiveUniform()#
Implementation
ActiveInfo getActiveUniform(Program program, int index) native;
getAttachedShaders()#
Implementation
List<Shader>? getAttachedShaders(Program program) native;
getAttribLocation()#
Implementation
int getAttribLocation(Program program, String name) native;
getBufferParameter()#
Implementation
@Creates('int|Null')
@Returns('int|Null')
Object? getBufferParameter(int target, int pname) native;
getContextAttributes()#
Implementation
@Creates('ContextAttributes|Null')
Map? getContextAttributes() {
return convertNativeToDart_Dictionary(_getContextAttributes_1());
}
getError()#
Implementation
int getError() native;
getExtension()#
Implementation
Object? getExtension(String name) native;
getFramebufferAttachmentParameter()#
Implementation
@Creates('int|Renderbuffer|Texture|Null')
@Returns('int|Renderbuffer|Texture|Null')
Object? getFramebufferAttachmentParameter(
int target,
int attachment,
int pname,
) native;
getParameter()#
Implementation
@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;
getProgramInfoLog()#
Implementation
String? getProgramInfoLog(Program program) native;
getProgramParameter()#
Implementation
@Creates('int|bool|Null')
@Returns('int|bool|Null')
Object? getProgramParameter(Program program, int pname) native;
getRenderbufferParameter()#
Implementation
@Creates('int|Null')
@Returns('int|Null')
Object? getRenderbufferParameter(int target, int pname) native;
getShaderInfoLog()#
Implementation
String? getShaderInfoLog(Shader shader) native;
getShaderParameter()#
Implementation
@Creates('int|bool|Null')
@Returns('int|bool|Null')
Object? getShaderParameter(Shader shader, int pname) native;
getShaderPrecisionFormat()#
Implementation
ShaderPrecisionFormat getShaderPrecisionFormat(
int shadertype,
int precisiontype,
) native;
getShaderSource()#
Implementation
String? getShaderSource(Shader shader) native;
getSupportedExtensions()#
Implementation
List<String>? getSupportedExtensions() native;
getTexParameter()#
Implementation
@Creates('int|Null')
@Returns('int|Null')
Object? getTexParameter(int target, int pname) native;
getUniform()#
Implementation
@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;
getUniformLocation()#
Implementation
UniformLocation getUniformLocation(Program program, String name) native;
getVertexAttrib()#
Implementation
@Creates('Null|num|bool|NativeFloat32List|Buffer')
@Returns('Null|num|bool|NativeFloat32List|Buffer')
Object? getVertexAttrib(int index, int pname) native;
getVertexAttribOffset()#
Implementation
int getVertexAttribOffset(int index, int pname) native;
hint()#
Implementation
void hint(int target, int mode) native;
isBuffer()#
Implementation
bool isBuffer(Buffer? buffer) native;
isContextLost()#
Implementation
bool isContextLost() native;
isEnabled()#
Implementation
bool isEnabled(int cap) native;
isFramebuffer()#
Implementation
bool isFramebuffer(Framebuffer? framebuffer) native;
isProgram()#
Implementation
bool isProgram(Program? program) native;
isRenderbuffer()#
Implementation
bool isRenderbuffer(Renderbuffer? renderbuffer) native;
isShader()#
Implementation
bool isShader(Shader? shader) native;
isTexture()#
Implementation
bool isTexture(Texture? texture) native;
lineWidth()#
Implementation
void lineWidth(num width) native;
linkProgram()#
Implementation
void linkProgram(Program program) native;
noSuchMethod() inherited#
Invoked when a nonexistent method or property is accessed.
A dynamic member invocation can attempt to call a member which doesn't exist on the receiving object. Example:
dynamic object = 1;
object.add(42); // Statically allowed, run-time error
This invalid code will invoke the noSuchMethod method
of the integer 1 with an Invocation
representing the
.add(42) call and arguments (which then throws).
Classes can override noSuchMethod to provide custom behavior for such invalid dynamic invocations.
A class with a non-default noSuchMethod invocation can also omit implementations for members of its interface. Example:
class MockList<T> implements List<T> {
noSuchMethod(Invocation invocation) {
log(invocation);
super.noSuchMethod(invocation); // Will throw.
}
}
void main() {
MockList().add(42);
}
This code has no compile-time warnings or errors even though
the MockList class has no concrete implementation of
any of the List interface methods.
Calls to List methods are forwarded to noSuchMethod,
so this code will log an invocation similar to
Invocation.method(#add, [42])
and then throw.
If a value is returned from noSuchMethod,
it becomes the result of the original invocation.
If the value is not of a type that can be returned by the original
invocation, a type error occurs at the invocation.
The default behavior is to throw a NoSuchMethodError.
Inherited from Interceptor.
Implementation
dynamic noSuchMethod(Invocation invocation) {
throw NoSuchMethodError.withInvocation(this, invocation);
}
pixelStorei()#
Implementation
void pixelStorei(int pname, int param) native;
polygonOffset()#
Implementation
void polygonOffset(num factor, num units) native;
readPixels()#
Implementation
void readPixels(
int x,
int y,
int width,
int height,
int format,
int type,
TypedData? pixels,
) {
_readPixels(x, y, width, height, format, type, pixels);
}
renderbufferStorage()#
Implementation
void renderbufferStorage(
int target,
int internalformat,
int width,
int height,
) native;
sampleCoverage()#
Implementation
void sampleCoverage(num value, bool invert) native;
scissor()#
Implementation
void scissor(int x, int y, int width, int height) native;
shaderSource()#
Implementation
void shaderSource(Shader shader, String string) native;
stencilFunc()#
Implementation
void stencilFunc(int func, int ref, int mask) native;
stencilFuncSeparate()#
Implementation
void stencilFuncSeparate(int face, int func, int ref, int mask) native;
stencilMask()#
Implementation
void stencilMask(int mask) native;
stencilMaskSeparate()#
Implementation
void stencilMaskSeparate(int face, int mask) native;
stencilOp()#
Implementation
void stencilOp(int fail, int zfail, int zpass) native;
stencilOpSeparate()#
Implementation
void stencilOpSeparate(int face, int fail, int zfail, int zpass) native;
texImage2D()#
Implementation
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");
}
deprecated texImage2DTyped()#
DEPRECATED
Use texImage2D
Sets the currently bound texture to data.
This is deprecated in favour of texImage2D.
Implementation
@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,
);
}
deprecated texImage2DUntyped()#
DEPRECATED
Use texImage2D
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.
Implementation
@Deprecated("Use texImage2D")
void texImage2DUntyped(
int targetTexture,
int levelOfDetail,
int internalFormat,
int format,
int type,
data,
) {
texImage2D(
targetTexture,
levelOfDetail,
internalFormat,
format,
type,
data,
);
}
texParameterf()#
Implementation
void texParameterf(int target, int pname, num param) native;
texParameteri()#
Implementation
void texParameteri(int target, int pname, int param) native;
texSubImage2D()#
Implementation
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");
}
deprecated texSubImage2DTyped()#
DEPRECATED
Use texSubImage2D
Updates a sub-rectangle of the currently bound texture to data.
Implementation
@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,
);
}
deprecated texSubImage2DUntyped()#
DEPRECATED
Use texSubImage2D
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.
Implementation
@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,
);
}
toString() inherited#
A string representation of this object.
Some classes have a default textual representation,
often paired with a static parse function (like int.parse).
These classes will provide the textual representation as
their string representation.
Other classes have no meaningful textual representation
that a program will care about.
Such classes will typically override toString to provide
useful information when inspecting the object,
mainly for debugging or logging.
Inherited from Interceptor.
Implementation
String toString() => Primitives.objectToHumanReadableString(this);
uniform1f()#
Implementation
void uniform1f(UniformLocation? location, num x) native;
uniform1fv()#
Implementation
void uniform1fv(UniformLocation? location, v) native;
uniform1i()#
Implementation
void uniform1i(UniformLocation? location, int x) native;
uniform1iv()#
Implementation
void uniform1iv(UniformLocation? location, v) native;
uniform2f()#
Implementation
void uniform2f(UniformLocation? location, num x, num y) native;
uniform2fv()#
Implementation
void uniform2fv(UniformLocation? location, v) native;
uniform2i()#
Implementation
void uniform2i(UniformLocation? location, int x, int y) native;
uniform2iv()#
Implementation
void uniform2iv(UniformLocation? location, v) native;
uniform3f()#
Implementation
void uniform3f(UniformLocation? location, num x, num y, num z) native;
uniform3fv()#
Implementation
void uniform3fv(UniformLocation? location, v) native;
uniform3i()#
Implementation
void uniform3i(UniformLocation? location, int x, int y, int z) native;
uniform3iv()#
Implementation
void uniform3iv(UniformLocation? location, v) native;
uniform4f()#
Implementation
void uniform4f(UniformLocation? location, num x, num y, num z, num w) native;
uniform4fv()#
Implementation
void uniform4fv(UniformLocation? location, v) native;
uniform4i()#
Implementation
void uniform4i(UniformLocation? location, int x, int y, int z, int w) native;
uniform4iv()#
Implementation
void uniform4iv(UniformLocation? location, v) native;
uniformMatrix2fv()#
Implementation
void uniformMatrix2fv(
UniformLocation? location,
bool transpose,
array,
) native;
uniformMatrix3fv()#
Implementation
void uniformMatrix3fv(
UniformLocation? location,
bool transpose,
array,
) native;
uniformMatrix4fv()#
Implementation
void uniformMatrix4fv(
UniformLocation? location,
bool transpose,
array,
) native;
useProgram()#
Implementation
void useProgram(Program? program) native;
validateProgram()#
Implementation
void validateProgram(Program program) native;
vertexAttrib1f()#
Implementation
void vertexAttrib1f(int indx, num x) native;
vertexAttrib1fv()#
Implementation
void vertexAttrib1fv(int indx, values) native;
vertexAttrib2f()#
Implementation
void vertexAttrib2f(int indx, num x, num y) native;
vertexAttrib2fv()#
Implementation
void vertexAttrib2fv(int indx, values) native;
vertexAttrib3f()#
Implementation
void vertexAttrib3f(int indx, num x, num y, num z) native;
vertexAttrib3fv()#
Implementation
void vertexAttrib3fv(int indx, values) native;
vertexAttrib4f()#
Implementation
void vertexAttrib4f(int indx, num x, num y, num z, num w) native;
vertexAttrib4fv()#
Implementation
void vertexAttrib4fv(int indx, values) native;
vertexAttribPointer()#
Implementation
void vertexAttribPointer(
int indx,
int size,
int type,
bool normalized,
int stride,
int offset,
) native;
viewport()#
Implementation
void viewport(int x, int y, int width, int height) native;
Operators#
operator ==() inherited#
The equality operator.
The default behavior for all Objects is to return true if and
only if this object and other are the same object.
Override this method to specify a different equality relation on a class. The overriding method must still be an equivalence relation. That is, it must be:
Total: It must return a boolean for all arguments. It should never throw.
Reflexive: For all objects
o,o == omust be true.-
Symmetric: For all objects
o1ando2,o1 == o2ando2 == o1must either both be true, or both be false. -
Transitive: For all objects
o1,o2, ando3, ifo1 == o2ando2 == o3are true, theno1 == o3must be true.
The method should also be consistent over time, so whether two objects are equal should only change if at least one of the objects was modified.
If a subclass overrides the equality operator, it should override the hashCode method as well to maintain consistency.
Inherited from Interceptor.
Implementation
bool operator ==(Object other) => identical(this, other);
Static Properties#
supported no setter#
Checks if this type is supported on the current platform.
Implementation
static bool get supported => JS('bool', '!!(window.WebGLRenderingContext)');