提交 5750c435 编写于 作者: M Mr.doob

Merge branch 'dev' of https://github.com/mrdoob/three.js into dev

......@@ -183,17 +183,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
_canvas.addEventListener( 'webglcontextlost', function ( event ) {
event.preventDefault();
resetGLState();
setDefaultGLState();
objects.clear();
properties.clear();
}, false );
_canvas.addEventListener( 'webglcontextlost', onContextLost, false );
} catch ( error ) {
......@@ -617,8 +607,26 @@ THREE.WebGLRenderer = function ( parameters ) {
this.resetGLState = resetGLState;
this.dispose = function() {
_canvas.removeEventListener( 'webglcontextlost', onContextLost, false );
};
// Events
function onContextLost( event ) {
event.preventDefault();
resetGLState();
setDefaultGLState();
objects.clear();
properties.clear();
};
function onTextureDispose( event ) {
var texture = event.target;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册