harmony 鸿蒙WebGL2

2022-08-09 浏览 (778)

WebGL2

The WebGL2 module supports graphics drawing, such as processing the graphics position and color. WebGL2 provides enhanced capabilities in the rendering pipeline and shader language than WebGL.

This module provides WebGL APIs that correspond to the OpenGL ES 3.0 feature set. For more information, see WebGL™.

NOTE

The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.

WebGL2 complies with the OpenGL protocol and does not support multi-thread calling.

This module can be used only in the JavaScript-compatible web-like development paradigm.

Invoking Method

Create a <canvas> component in the HML file. The following is an example:

<!--xxx.hml-->
<div class="container">
    <canvas ref="canvas1" style="width : 400px; height : 200px; background-color : lightyellow;"></canvas>
    <button class="btn-button" onclick="BtnDraw2D">BtnDraw2D</button>
</div>

Obtain the <canvas> component instance in the JS file. The following is an example:

// Obtain the <canvas> component instance.
const el = this.$refs.canvas1;
// Obtain the WebGL context from the <canvas> component instance.
const gl = el.getContext('webgl2');
// Call the WebGL API.
gl.clearColor(0.0, 0.0, 0.0, 1.0);

Type

System capability: SystemCapability.Graphic.Graphic2D.WebGL2

Table 1 Type

NameType
GLenumnumber
GLint64number
GLuint64number
Uint32Listarray

APIs

System capability: SystemCapability.Graphic.Graphic2D.WebGL2

Table 2 APIs

Name
WebGL2RenderingContextBase
WebGL2RenderingContextOverloads
WebGLQuery
WebGLSampler
WebGLSync
WebGLTransformFeedback
WebGLVertexArrayObject

WebGL2RenderingContextBase

WebGL2RenderingContextBase

Attributes

NameTypeMandatory
READ_BUFFERGLenumYes
UNPACK_ROW_LENGTHGLenumYes
UNPACK_SKIP_ROWSGLenumYes
UNPACK_SKIP_PIXELSGLenumYes
PACK_ROW_LENGTHGLenumYes
PACK_SKIP_ROWSGLenumYes
PACK_SKIP_PIXELSGLenumYes
COLORGLenumYes
DEPTHGLenumYes
STENCILGLenumYes
REDGLenumYes
RGB8GLenumYes
RGBA8GLenumYes
RGB10_A2GLenumYes
TEXTURE_BINDING_3DGLenumYes
UNPACK_SKIP_IMAGESGLenumYes
UNPACK_IMAGE_HEIGHTGLenumYes
TEXTURE_3DGLenumYes
TEXTURE_WRAP_RGLenumYes
MAX_3D_TEXTURE_SIZEGLenumYes
UNSIGNED_INT_2_10_10_10_REVGLenumYes
MAX_ELEMENTS_VERTICESGLenumYes
MAX_ELEMENTS_INDICESGLenumYes
TEXTURE_MIN_LODGLenumYes
TEXTURE_MAX_LODGLenumYes
TEXTURE_BASE_LEVELGLenumYes
TEXTURE_MAX_LEVELGLenumYes
MINGLenumYes
MAXGLenumYes
DEPTH_COMPONENT24GLenumYes
MAX_TEXTURE_LOD_BIASGLenumYes
TEXTURE_COMPARE_MODEGLenumYes
TEXTURE_COMPARE_FUNCGLenumYes
CURRENT_QUERYGLenumYes
QUERY_RESULTGLenumYes
QUERY_RESULT_AVAILABLEGLenumYes
STREAM_READGLenumYes
STREAM_COPYGLenumYes
STATIC_READGLenumYes
STATIC_COPYGLenumYes
DYNAMIC_READGLenumYes
DYNAMIC_COPYGLenumYes
MAX_DRAW_BUFFERSGLenumYes
DRAW_BUFFER0GLenumYes
DRAW_BUFFER1GLenumYes
DRAW_BUFFER2GLenumYes
DRAW_BUFFER3GLenumYes
DRAW_BUFFER4GLenumYes
DRAW_BUFFER5GLenumYes
DRAW_BUFFER6GLenumYes
DRAW_BUFFER7GLenumYes
DRAW_BUFFER8GLenumYes
DRAW_BUFFER9GLenumYes
DRAW_BUFFER10GLenumYes
DRAW_BUFFER11GLenumYes
DRAW_BUFFER12GLenumYes
DRAW_BUFFER13GLenumYes
DRAW_BUFFER14GLenumYes
DRAW_BUFFER15GLenumYes
MAX_FRAGMENT_UNIFORM_COMPONENTSGLenumYes
MAX_VERTEX_UNIFORM_COMPONENTSGLenumYes
SAMPLER_3DGLenumYes
SAMPLER_2D_SHADOWGLenumYes
FRAGMENT_SHADER_DERIVATIVE_HINTGLenumYes
PIXEL_PACK_BUFFERGLenumYes
PIXEL_UNPACK_BUFFERGLenumYes
PIXEL_PACK_BUFFER_BINDINGGLenumYes
PIXEL_UNPACK_BUFFER_BINDINGGLenumYes
FLOAT_MAT2x3GLenumYes
FLOAT_MAT2x4GLenumYes
FLOAT_MAT3x2GLenumYes
FLOAT_MAT3x4GLenumYes
FLOAT_MAT4x2GLenumYes
FLOAT_MAT4x3GLenumYes
SRGBGLenumYes
SRGB8GLenumYes
SRGB8_ALPHA8GLenumYes
COMPARE_REF_TO_TEXTUREGLenumYes
RGBA32FGLenumYes
RGB32FGLenumYes
RGBA16FGLenumYes
RGB16FGLenumYes
VERTEX_ATTRIB_ARRAY_INTEGERGLenumYes
MAX_ARRAY_TEXTURE_LAYERSGLenumYes
MIN_PROGRAM_TEXEL_OFFSETGLenumYes
MAX_PROGRAM_TEXEL_OFFSETGLenumYes
MAX_VARYING_COMPONENTSGLenumYes
TEXTURE_2D_ARRAYGLenumYes
TEXTURE_BINDING_2D_ARRAYGLenumYes
R11F_G11F_B10FGLenumYes
UNSIGNED_INT_10F_11F_11F_REVGLenumYes
RGB9_E5GLenumYes
UNSIGNED_INT_5_9_9_9_REVGLenumYes
TRANSFORM_FEEDBACK_BUFFER_MODEGLenumYes
MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTSGLenumYes
TRANSFORM_FEEDBACK_VARYINGSGLenumYes
TRANSFORM_FEEDBACK_BUFFER_STARTGLenumYes
TRANSFORM_FEEDBACK_BUFFER_SIZEGLenumYes
TRANSFORM_FEEDBACK_PRIMITIVES_WRITTENGLenumYes
RASTERIZER_DISCARDGLenumYes
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTSGLenumYes
MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBSGLenumYes
INTERLEAVED_ATTRIBSGLenumYes
SEPARATE_ATTRIBSGLenumYes
TRANSFORM_FEEDBACK_BUFFERGLenumYes
TRANSFORM_FEEDBACK_BUFFER_BINDINGGLenumYes
RGBA32UIGLenumYes
RGB32UIGLenumYes
RGBA16UIGLenumYes
RGB16UIGLenumYes
RGBA8UIGLenumYes
RGB8UIGLenumYes
RGBA32IGLenumYes
RGB32IGLenumYes
RGBA16IGLenumYes
RGB16IGLenumYes
RGBA8IGLenumYes
RGB8IGLenumYes
RED_INTEGERGLenumYes
RGB_INTEGERGLenumYes
RGBA_INTEGERGLenumYes
SAMPLER_2D_ARRAYGLenumYes
SAMPLER_2D_ARRAY_SHADOWGLenumYes
SAMPLER_CUBE_SHADOWGLenumYes
UNSIGNED_INT_VEC2GLenumYes
UNSIGNED_INT_VEC3GLenumYes
UNSIGNED_INT_VEC4GLenumYes
INT_SAMPLER_2DGLenumYes
INT_SAMPLER_3DGLenumYes
INT_SAMPLER_CUBEGLenumYes
INT_SAMPLER_2D_ARRAYGLenumYes
UNSIGNED_INT_SAMPLER_2DGLenumYes
UNSIGNED_INT_SAMPLER_3DGLenumYes
UNSIGNED_INT_SAMPLER_CUBEGLenumYes
UNSIGNED_INT_SAMPLER_2D_ARRAYGLenumYes
DEPTH_COMPONENT32FGLenumYes
DEPTH32F_STENCIL8GLenumYes
FLOAT_32_UNSIGNED_INT_24_8_REVGLenumYes
FRAMEBUFFER_ATTACHMENT_COLOR_ENCODINGGLenumYes
FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPEGLenumYes
FRAMEBUFFER_ATTACHMENT_RED_SIZEGLenumYes
FRAMEBUFFER_ATTACHMENT_GREEN_SIZEGLenumYes
FRAMEBUFFER_ATTACHMENT_BLUE_SIZEGLenumYes
FRAMEBUFFER_ATTACHMENT_ALPHA_SIZEGLenumYes
FRAMEBUFFER_ATTACHMENT_DEPTH_SIZEGLenumYes
FRAMEBUFFER_ATTACHMENT_STENCIL_SIZEGLenumYes
FRAMEBUFFER_DEFAULTGLenumYes
UNSIGNED_INT_24_8GLenumYes
DEPTH24_STENCIL8GLenumYes
UNSIGNED_NORMALIZEDGLenumYes
DRAW_FRAMEBUFFER_BINDINGGLenumYes
READ_FRAMEBUFFERGLenumYes
DRAW_FRAMEBUFFERGLenumYes
READ_FRAMEBUFFER_BINDINGGLenumYes
RENDERBUFFER_SAMPLESGLenumYes
FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYERGLenumYes
MAX_COLOR_ATTACHMENTSGLenumYes
COLOR_ATTACHMENT1GLenumYes
COLOR_ATTACHMENT2GLenumYes
COLOR_ATTACHMENT3GLenumYes
COLOR_ATTACHMENT4GLenumYes
COLOR_ATTACHMENT5GLenumYes
COLOR_ATTACHMENT6GLenumYes
COLOR_ATTACHMENT7GLenumYes
COLOR_ATTACHMENT8GLenumYes
COLOR_ATTACHMENT9GLenumYes
COLOR_ATTACHMENT10GLenumYes
COLOR_ATTACHMENT11GLenumYes
COLOR_ATTACHMENT12GLenumYes
COLOR_ATTACHMENT13GLenumYes
COLOR_ATTACHMENT14GLenumYes
COLOR_ATTACHMENT15GLenumYes
FRAMEBUFFER_INCOMPLETE_MULTISAMPLEGLenumYes
MAX_SAMPLESGLenumYes
HALF_FLOATGLenumYes
RGGLenumYes
RG_INTEGERGLenumYes
R8GLenumYes
RG8GLenumYes
R16FGLenumYes
R32FGLenumYes
RG16FGLenumYes
RG32FGLenumYes
R8IGLenumYes
R8UIGLenumYes
R16IGLenumYes
R16UIGLenumYes
R32IGLenumYes
R32UIGLenumYes
RG8IGLenumYes
RG8UIGLenumYes
RG16IGLenumYes
RG16UIGLenumYes
RG32IGLenumYes
RG32UIGLenumYes
VERTEX_ARRAY_BINDINGGLenumYes
R8_SNORMGLenumYes
RG8_SNORMGLenumYes
RGB8_SNORMGLenumYes
SIGNED_NORMALIZEDGLenumYes
COPY_READ_BUFFERGLenumYes
COPY_WRITE_BUFFERGLenumYes
COPY_READ_BUFFER_BINDINGGLenumYes
COPY_WRITE_BUFFER_BINDINGGLenumYes
UNIFORM_BUFFERGLenumYes
UNIFORM_BUFFER_BINDINGGLenumYes
UNIFORM_BUFFER_STARTGLenumYes
UNIFORM_BUFFER_SIZEGLenumYes
MAX_VERTEX_UNIFORM_BLOCKSGLenumYes
MAX_FRAGMENT_UNIFORM_BLOCKSGLenumYes
MAX_COMBINED_UNIFORM_BLOCKSGLenumYes
MAX_UNIFORM_BUFFER_BINDINGSGLenumYes
MAX_UNIFORM_BLOCK_SIZEGLenumYes
MAX_COMBINED_VERTEX_UNIFORM_COMPONENTSGLenumYes
MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTSGLenumYes
UNIFORM_BUFFER_OFFSET_ALIGNMENTGLenumYes
ACTIVE_UNIFORM_BLOCKSGLenumYes
UNIFORM_TYPEGLenumYes
UNIFORM_SIZEGLenumYes
UNIFORM_BLOCK_INDEXGLenumYes
UNIFORM_OFFSETGLenumYes
UNIFORM_ARRAY_STRIDEGLenumYes
UNIFORM_MATRIX_STRIDEGLenumYes
UNIFORM_IS_ROW_MAJORGLenumYes
UNIFORM_BLOCK_BINDINGGLenumYes
UNIFORM_BLOCK_DATA_SIZEGLenumYes
UNIFORM_BLOCK_ACTIVE_UNIFORMSGLenumYes
UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICESGLenumYes
UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADERGLenumYes
UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADERGLenumYes
INVALID_INDEXGLenumYes
MAX_VERTEX_OUTPUT_COMPONENTSGLenumYes
MAX_FRAGMENT_INPUT_COMPONENTSGLenumYes
MAX_SERVER_WAIT_TIMEOUTGLenumYes
OBJECT_TYPEGLenumYes
SYNC_CONDITIONGLenumYes
SYNC_STATUSGLenumYes
SYNC_FLAGSGLenumYes
SYNC_FENCEGLenumYes
SYNC_GPU_COMMANDS_COMPLETEGLenumYes
UNSIGNALEDGLenumYes
SIGNALEDGLenumYes
ALREADY_SIGNALEDGLenumYes
TIMEOUT_EXPIREDGLenumYes
CONDITION_SATISFIEDGLenumYes
WAIT_FAILEDGLenumYes
SYNC_FLUSH_COMMANDS_BITGLenumYes
VERTEX_ATTRIB_ARRAY_DIVISORGLenumYes
ANY_SAMPLES_PASSEDGLenumYes
ANY_SAMPLES_PASSED_CONSERVATIVEGLenumYes
SAMPLER_BINDINGGLenumYes
RGB10_A2UIGLenumYes
INT_2_10_10_10_REVGLenumYes
TRANSFORM_FEEDBACKGLenumYes
TRANSFORM_FEEDBACK_PAUSEDGLenumYes
TRANSFORM_FEEDBACK_ACTIVEGLenumYes
TRANSFORM_FEEDBACK_BINDINGGLenumYes
TEXTURE_IMMUTABLE_FORMATGLenumYes
MAX_ELEMENT_INDEXGLenumYes
TEXTURE_IMMUTABLE_LEVELSGLenumYes
TIMEOUT_IGNOREDGLint64Yes
MAX_CLIENT_WAIT_TIMEOUT_WEBGLGLenumYes

Methods

MethodReturn Value Type
copyBufferSubData(readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr)void
getBufferSubData(target: GLenum, srcByteOffset: GLintptr, dstBuffer: ArrayBufferView, dstOffset?: GLuint, length?: GLuint)void
blitFramebuffer(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum)void
framebufferTextureLayer(target: GLenum, attachment: GLenum, texture: WebGLTexture |null, level: GLint, layer: GLint)void
invalidateFramebuffer(target: GLenum, attachments: GLenum[])void
invalidateSubFramebuffer(target: GLenum, attachments: GLenum[], x: GLint, y: GLint, width: GLsizei, height: GLsizei)void
readBuffer(src: GLenum)void
getInternalformatParameter(target: GLenum, internalformat: GLenum, pname: GLenum)any
renderbufferStorageMultisample(target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei)void
texStorage2D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei)void
texStorage3D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei)void
texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr)void
texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource)void
texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView |null)void
texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint)void
texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr)void
texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: TexImageSource)void
texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView |null, srcOffset?: GLuint)void
copyTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei)void
compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr)void
compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint)void
compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr)void
compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint)void
getFragDataLocation(program: WebGLProgram, name: string)GLint
uniform1ui(location: WebGLUniformLocation |null, v0: GLuint)void
uniform2ui(location: WebGLUniformLocation |null, v0: GLuint, v1: GLuint)void
uniform3ui(location: WebGLUniformLocation |null, v0: GLuint, v1: GLuint, v2: GLuint)void
uniform4ui(location: WebGLUniformLocation |null, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint)void
uniform1uiv(location: WebGLUniformLocation |null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniform2uiv(location: WebGLUniformLocation |null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniform3uiv(location: WebGLUniformLocation |null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniform4uiv(location: WebGLUniformLocation |null, data: Uint32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniformMatrix3x2fv(location: WebGLUniformLocation |null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniformMatrix4x2fv(location: WebGLUniformLocation |null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniformMatrix2x3fv(location: WebGLUniformLocation |null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniformMatrix4x3fv(location: WebGLUniformLocation |null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniformMatrix2x4fv(location: WebGLUniformLocation |null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniformMatrix3x4fv(location: WebGLUniformLocation |null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint)void
vertexAttribI4i(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint)void
vertexAttribI4iv(index: GLuint, values: Int32List)void
vertexAttribI4ui(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint)void
vertexAttribI4uiv(index: GLuint, values: Uint32List)void
vertexAttribIPointer(index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr)void
vertexAttribDivisor(index: GLuint, divisor: GLuint)void
drawArraysInstanced(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei)void
drawElementsInstanced(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei)void
drawRangeElements(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type: GLenum, offset: GLintptr)void
drawBuffers(buffers: GLenum[])void
clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Float32List, srcOffset?: GLuint)void
clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Int32List, srcOffset?: GLuint)void
clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Uint32List, srcOffset?: GLuint)void
clearBufferfi(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint)void
createQuery()WebGLQuery |null
deleteQuery(query: WebGLQuery |null)void
isQuery(query: WebGLQuery |null)GLboolean
beginQuery(target: GLenum, query: WebGLQuery)void
endQuery(target: GLenum)void
getQuery(target: GLenum, pname: GLenum)WebGLQuery |null
getQueryParameter(query: WebGLQuery, pname: GLenum)any
createSampler()WebGLSampler |null
deleteSampler(sampler: WebGLSampler |null)void
isSampler(sampler: WebGLSampler |null)GLboolean
bindSampler(unit: GLuint, sampler: WebGLSampler |null)void
samplerParameteri(sampler: WebGLSampler, pname: GLenum, param: GLint)void
samplerParameterf(sampler: WebGLSampler, pname: GLenum, param: GLfloat)void;
getSamplerParameter(sampler: WebGLSampler, pname: GLenum)any
fenceSync(condition: GLenum, flags: GLbitfield)WebGLSync |null
isSync(sync: WebGLSync |null)GLboolean
deleteSync(sync: WebGLSync |null)void
clientWaitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLuint64)GLenum
waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64)void
getSyncParameter(sync: WebGLSync, pname: GLenum)any
createTransformFeedback()WebGLTransformFeedback |null
deleteTransformFeedback(tf: WebGLTransformFeedback |null)void
isTransformFeedback(tf: WebGLTransformFeedback |null)GLboolean
bindTransformFeedback(target: GLenum, tf: WebGLTransformFeedback |null)void
beginTransformFeedback(primitiveMode: GLenum)void
endTransformFeedback()void
transformFeedbackVaryings(program: WebGLProgram, varyings: string[], bufferMode: GLenum)void
getTransformFeedbackVarying(program: WebGLProgram, index: GLuint)WebGLActiveInfo |null
pauseTransformFeedback()void
resumeTransformFeedback()void
bindBufferBase(target: GLenum, index: GLuint, buffer: WebGLBuffer |null)void
bindBufferRange(target: GLenum, index: GLuint, buffer: WebGLBuffer |null, offset: GLintptr, size: GLsizeiptr)void
getIndexedParameter(target: GLenum, index: GLuint)any
getUniformIndices(program: WebGLProgram, uniformNames: string[])GLuint[] |null
getActiveUniforms(program: WebGLProgram, uniformIndices: GLuint[], pname: GLenum)any
getUniformBlockIndex(program: WebGLProgram, uniformBlockName: string)GLuint
getActiveUniformBlockParameter(program: WebGLProgram, uniformBlockIndex: GLuint, pname: GLenum)any
getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: GLuint)string |null
uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint)void
createVertexArray()WebGLVertexArrayObject |null
deleteVertexArray(vertexArray: WebGLVertexArrayObject |null)void
isVertexArray(vertexArray: WebGLVertexArrayObject |null)GLboolean
bindVertexArray(array: WebGLVertexArrayObject |null)void

WebGL2RenderingContextOverloads

WebGL2RenderingContextOverloads

MethodReturn Value Type
bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum)void
bufferData(target: GLenum, srcData: BufferSource |null, usage: GLenum)void
bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: BufferSource)void
bufferData(target: GLenum, srcData: ArrayBufferView, usage: GLenum, srcOffset: GLuint, length?: GLuint)void
bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView, srcOffset: GLuint, length?: GLuint)void
texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView |null)void
texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource)void
texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView |null)void
texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource)void
texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr)void
texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: TexImageSource)void
texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint)void
texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr)void
texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: TexImageSource)void
texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint)void
compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr)void
compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint)void
compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr)void
compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset?: GLuint, srcLengthOverride?: GLuint)void
uniform1fv(location: WebGLUniformLocation |null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniform2fv(location: WebGLUniformLocation |null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniform3fv(location: WebGLUniformLocation |null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniform4fv(location: WebGLUniformLocation |null, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniform1iv(location: WebGLUniformLocation |null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniform2iv(location: WebGLUniformLocation |null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniform3iv(location: WebGLUniformLocation |null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniform4iv(location: WebGLUniformLocation |null, data: Int32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniformMatrix2fv(location: WebGLUniformLocation |null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniformMatrix3fv(location: WebGLUniformLocation |null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint)void
uniformMatrix4fv(location: WebGLUniformLocation |null, transpose: GLboolean, data: Float32List, srcOffset?: GLuint, srcLength?: GLuint)void
readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView |null)void
readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, offset: GLintptr)void
readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView, dstOffset: GLuint)void

你可能感兴趣的鸿蒙文章

harmony 鸿蒙APIs

harmony 鸿蒙System Common Events (To Be Deprecated Soon)

harmony 鸿蒙System Common Events

harmony 鸿蒙API Reference Document Description

harmony 鸿蒙BundleStatusCallback

harmony 鸿蒙@ohos.bundle.innerBundleManager (innerBundleManager)

harmony 鸿蒙@ohos.distributedBundle (Distributed Bundle Management)

harmony 鸿蒙@ohos.bundle (Bundle)

harmony 鸿蒙@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)

harmony 鸿蒙@ohos.WorkSchedulerExtensionAbility (Work Scheduler Callbacks)

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/22116b1a18614a1aa0bd6e194bb7ff59