2017-09-05 04:59:34 +03:00
|
|
|
import XRLayer from './XRLayer.js'
|
|
|
|
|
|
|
|
/*
|
|
|
|
XRWebGLLayer defines the WebGL or WebGL 2 context that is rendering the visuals for this layer.
|
|
|
|
*/
|
|
|
|
export default class XRWebGLLayer extends XRLayer {
|
|
|
|
constructor(session, context){
|
|
|
|
super()
|
|
|
|
this._session = session
|
|
|
|
this._context = context
|
2017-12-09 00:08:14 +03:00
|
|
|
this._width = this._context.canvas.width;
|
|
|
|
this._height = this._context.canvas.height;
|
2017-09-05 04:59:34 +03:00
|
|
|
this._framebuffer = null // TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
get context(){ return this._context }
|
|
|
|
|
|
|
|
get antialias(){
|
|
|
|
// readonly attribute boolean antialias;
|
|
|
|
throw 'Not implemented'
|
|
|
|
}
|
|
|
|
|
|
|
|
get depth(){
|
|
|
|
// readonly attribute boolean depth;
|
|
|
|
throw 'Not implemented'
|
|
|
|
}
|
|
|
|
|
|
|
|
get stencil(){
|
|
|
|
// readonly attribute boolean stencil;
|
|
|
|
throw 'Not implemented'
|
|
|
|
}
|
|
|
|
|
|
|
|
get alpha(){
|
|
|
|
// readonly attribute boolean alpha;
|
|
|
|
throw 'Not implemented'
|
|
|
|
}
|
|
|
|
|
|
|
|
get multiview(){
|
|
|
|
// readonly attribute boolean multiview;
|
|
|
|
throw 'Not implemented'
|
|
|
|
}
|
|
|
|
|
|
|
|
get framebuffer(){
|
|
|
|
return this._framebuffer
|
|
|
|
}
|
|
|
|
|
2017-12-09 00:08:14 +03:00
|
|
|
set framebufferWidth(w){
|
|
|
|
this._width = w;
|
|
|
|
this._context.canvas.width = w;
|
|
|
|
}
|
|
|
|
|
2017-09-05 04:59:34 +03:00
|
|
|
get framebufferWidth(){
|
2017-12-06 23:01:29 +03:00
|
|
|
// not using this for now, on iOS it's not good.
|
|
|
|
// var pr = window.devicePixelRatio || 1;
|
2017-12-08 18:00:30 +03:00
|
|
|
//return this._context.canvas.clientWidth;
|
2017-12-09 00:08:14 +03:00
|
|
|
return this._width;
|
|
|
|
}
|
|
|
|
|
|
|
|
set framebufferHeight(h){
|
|
|
|
this._height = h;
|
|
|
|
this._context.canvas.height = h;
|
2017-09-05 04:59:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
get framebufferHeight(){
|
2017-12-06 23:01:29 +03:00
|
|
|
// not using this for now, on iOS it's not good.
|
|
|
|
// var pr = window.devicePixelRatio || 1;
|
2017-12-08 18:00:30 +03:00
|
|
|
//return this._context.canvas.clientHeight;
|
2017-12-09 00:08:14 +03:00
|
|
|
return this._height;
|
2017-09-05 04:59:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
requestViewportScaling(viewportScaleFactor){
|
|
|
|
// void requestViewportScaling(double viewportScaleFactor);
|
|
|
|
throw 'Not implemented'
|
|
|
|
}
|
|
|
|
}
|