alibaba / alibaba/GCanvas

无法在ReactNative下使用webgl

Open
#45 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
1.9k
Forks
219
PR merge metrics
No merged PRs in 30d

Description

在集成GCanvas到ReactNative环境后,我发现使用webgl context连基本的clearColor和clear都无法工作,后来自己摸索了一会,发现bridge-reactnative.js里的flushNative和callNative实现是空的,我把bridge-weex.js里的代码挪过去后,就可以正常工作了。我想问GCanvas对于ReactNative下webgl的支持是尚未完成状态吗?

我的ReactNative项目依赖如下:
```
"dependencies": {
"gcanvas.js": "0.0.8",
"react": "16.2.0",
"react-native": "0.52.0",
"react-native-gcanvas": "0.0.7-dev"
}
```

使用代码:
```
let gl = ref.getContext('webgl')
gl.clearColor(1.0, 1.0, 0.0, 1.0);
gl.enable(gl.DEPTH_TEST);
gl.depthFunc(gl.LEQUAL);
gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);
```

Contributor guide

Open the contributing guide

Research direction

Start with bridge-reactnative.js, where flushNative and callNative are reported as empty, and compare those entry points with bridge-weex.js. Reproduce the supplied React Native WebGL calls, including clearColor and clear; done means the calls work through the React Native bridge with the listed dependency versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
computer-graphics, mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.