提交 c49ebce8 编写于 作者: M muppets

fix webgl guidance

Signed-off-by: Nmuppets <yangguangyu6@huawei.com>
上级 01e917a4
......@@ -7,13 +7,6 @@
WebGL标准图形API,对应OpenGL ES 2.0特性集。更多信息请参考[WebGL™标准](https://www.khronos.org/registry/webgl/specs/latest/1.0/)
## 导入模块
```
import webgl from '@ohos.webglnapi'
```
## 调用方式
hml内创建canvas,示例如下:
......
......@@ -7,13 +7,6 @@
WebGL标准图形API,对应OpenGL ES 3.0特性集。更多信息请参考[WebGL™标准](https://www.khronos.org/registry/webgl/specs/latest/2.0/)
## 导入模块
```
import webgl from '@ohos.webglnapi'
```
## 调用方式
hml内创建canvas,示例如下:
......@@ -33,7 +26,7 @@ js内获取canvas实例,示例如下:
// 获取canvas组件实例
const el = this.$refs.canvas1;
// 从canvas组件实例获取WebGL上下文
const gl = el.getContext('webgl');
const gl = el.getContext('webgl2');
// 调用WebGL API
gl.clearColor(0.0, 0.0, 0.0, 1.0);
```
......
......@@ -7,12 +7,6 @@ WebGL主要帮助开发者在前端开发中完成图形图像的相关处理,
## 接口说明
使用WebGL开放能力需导入模块:
```
import webgl from "@ohos.webglnapi";
```
**表1** WebGL主要接口列表
| 接口名 | 描述 |
......@@ -142,7 +136,6 @@ import webgl from "@ohos.webglnapi";
3. 编辑JavaScript代码文件,增加彩色三角形绘制逻辑代码。index.js示例如下:
```
//index.js
import webgl from "@ohos.webglnapi";//导入WebGL模块
//WebGL相关预定义
var gl = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册