How do I set the attributes of a WebGL context aft

2019-09-17 00:34发布

I know that we can specify attributes for a WebGL context when we create the context:

var ctx = myCanvas.getContext(‘webgl’, attributes);

Is there a method that we can call to set the attributes of ctx after ctx has been created? For instance, can we do something akin to

var ctx = myCanvas.getContext(‘webgl’);
ctx.setAttributes(attributes);

标签: webgl
1条回答
Evening l夕情丶
2楼-- · 2019-09-17 01:00

That would require being able to change the attributes of a context. Which you're not allowed to do. They're fixed at context creation time.

查看更多
登录 后发表回答