未验证 提交 96f301fa 编写于 作者: O openharmony_ci 提交者: Gitee

!8721 翻译完成:8561 3.2Beta2:WebGL添加说明,需同步翻译

Merge pull request !8721 from wusongqing/TR8561
# webgl
> **NOTE**<br/>
> 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.
# WebGL
The **WebGL** module provides the graphics drawing capability, such as processing the graphics position and color.
This module provides WebGL APIs that correspond to the OpenGL ES 2.0 feature set. For more information, see [WebGL™](https://www.khronos.org/registry/webgl/specs/latest/1.0/).
> **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.
>
> WebGL complies with the OpenGL protocol and does not support multi-thread calling.
## Invoking Method
......@@ -37,7 +41,7 @@ gl.clearColor(0.0, 0.0, 0.0, 1.0);
**System capability**: SystemCapability.Graphic.Graphic2D.WebGL
**Table 1** Type
**Table 1** Type
| Name| Type|
| -------- | -------- |
......@@ -61,11 +65,11 @@ gl.clearColor(0.0, 0.0, 0.0, 1.0);
| WebGLPowerPreference | string |
## Interface
## APIs
**System capability**: SystemCapability.Graphic.Graphic2D.WebGL
**Table 2** Interface
**Table 2** APIs
| Name|
| -------- |
......@@ -88,7 +92,7 @@ gl.clearColor(0.0, 0.0, 0.0, 1.0);
WebGLContextAttributes
| Name| Type| Mandatory|
| Name| Type| Mandatory|
| -------- | -------- | -------- |
| alpha | boolean | No|
| depth | boolean | No|
......@@ -105,7 +109,7 @@ WebGLContextAttributes
WebGLActiveInfo
| Name| Type| Mandatory|
| Name| Type| Mandatory|
| -------- | -------- | -------- |
| size | GLint | Yes|
| type | GLenum | Yes|
......@@ -116,7 +120,7 @@ WebGLActiveInfo
WebGLShaderPrecisionFormat
| Name| Type| Mandatory|
| Name| Type| Mandatory|
| -------- | -------- | -------- |
| rangeMin | GLint | Yes|
| rangeMax | GLint | Yes|
......@@ -130,7 +134,7 @@ WebGLRenderingContextBase
### Attributes
| Name| Type| Mandatory|
| Name| Type| Mandatory|
| -------- | -------- | -------- |
| DEPTH_BUFFER_BIT | GLenum | Yes|
| STENCIL_BUFFER_BIT | GLenum | Yes|
......@@ -433,7 +437,7 @@ WebGLRenderingContextBase
### Methods
| Method| Return Value Type|
| Method| Return Value Type|
| -------- | -------- |
| getContextAttributes() | WebGLContextAttributes \| null |
| isContextLost() | boolean |
......@@ -559,7 +563,7 @@ WebGLRenderingContextBase
WebGLRenderingContextOverloads
| Method| Return Value Type|
| Method| Return Value Type|
| -------- | -------- |
| bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) | void |
| bufferData(target: GLenum, data: BufferSource \| null, usage: GLenum) | void |
......
# webgl2
> **NOTE**<br/>
> 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
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™](https://www.khronos.org/registry/webgl/specs/latest/2.0/).
> **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.
## Invoking Method
......@@ -37,7 +41,7 @@ gl.clearColor(0.0, 0.0, 0.0, 1.0);
**System capability**: SystemCapability.Graphic.Graphic2D.WebGL2
**Table 1** Type
**Table 1** Type
| Name| Type|
| -------- | -------- |
......@@ -47,11 +51,11 @@ gl.clearColor(0.0, 0.0, 0.0, 1.0);
| Uint32List | array |
## Interface
## APIs
**System capability**: SystemCapability.Graphic.Graphic2D.WebGL2
**Table 2** Interface
**Table 2** APIs
| Name|
| -------- |
......@@ -71,7 +75,7 @@ WebGL2RenderingContextBase
### Attributes
| Name| Type| Mandatory|
| Name| Type| Mandatory|
| -------- | -------- | -------- |
| READ_BUFFER | GLenum | Yes|
| UNPACK_ROW_LENGTH | GLenum | Yes|
......@@ -339,7 +343,7 @@ WebGL2RenderingContextBase
### Methods
| Method| Return Value Type|
| Method| Return 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 |
......@@ -442,7 +446,7 @@ WebGL2RenderingContextBase
WebGL2RenderingContextOverloads
| Method| Return Value Type|
| Method| Return Value Type|
| -------- | -------- |
| bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) | void |
| bufferData(target: GLenum, srcData: BufferSource \| null, usage: GLenum) | void |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册