目前JsBridge仅支持getContext(“2d”)而不支持getContext(“webgl”)。
public object getContext(string contextType)
{
if (contextType == "2d") {
if (this.context == null) {
this.context = new CanvasRenderingContext2D(this.window, this);
}
return this.context;
}
return null;
}
理想情况下,要使JsBridge支持3D,需要
public object getContext(string contextType)
{
if (contextType == "2d") {
if (this.context == null) {
this.context = new CanvasRenderingContext2D(this.window, this);
}
return this.context;
}
else if (contextType == "experimental-webgl" || contextType == "webgl")
{
if (this.context == null)
{
this.context = new WebGLRenderingContext(this.window, this);
}
return this.context;
}
return null;
}
我的猜测是我们需要编写一个新类WebGLRenderingContext.cs以使JsBridge与例如three.js?
Microsoft Chakra github有OpenGL example
任何人都可以提供基于JsBridge和Microsoft Chakra opengl示例的建议,如何开始编写WebGLRenderingContext.cs?
2016年9月14日修订 使ChakraBridge与WebGl.js或派生框架一起工作,例如Three.js,需要解决多个差距以定位WebGL 3D上下文: