Stage3D主类:Context3D

Stage3D API的主类不是Stage3D本身,而是一个叫做Context3D的类。可以通过Context3D申请顶点缓冲VertexBuffer3D、顶点索引IndexBuffer3D、着色器程序Program3D,装入数据再上传至GPU渲染界面。

使用Stage3D对象时请求Context3D方法如下:

stage.stage3Ds[0].addEventListener( Event.CONTEXT3D_CREATE, initStage3D ); 
stage.stage3Ds[0].requestContext3D(); 

... 

protected function initStage3D(e:Event):void 
{ 
    context3D = stage.stage3Ds[0].context3D; 
}


 

 

你可能感兴趣的:(Stage3D主类:Context3D)