未验证 提交 efd5bb64 编写于 作者: M Mr.doob 提交者: GitHub

WebGLRenderer: Check if device.isConnected before requesting frame.

上级 c04e8d1a
......@@ -1024,7 +1024,10 @@ function WebGLRenderer( parameters ) {
function start() {
if ( isAnimating ) return;
( vr.getDevice() || window ).requestAnimationFrame( loop );
var device = vr.getDevice();
( ( device && device.isConnected ) || window ).requestAnimationFrame( loop );
isAnimating = true;
}
......@@ -1032,7 +1035,9 @@ function WebGLRenderer( parameters ) {
function loop( time ) {
if ( onAnimationFrame !== null ) onAnimationFrame( time );
( vr.getDevice() || window ).requestAnimationFrame( loop );
var device = vr.getDevice();
( ( device && device.isConnected ) || window ).requestAnimationFrame( loop );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册