瀏覽代碼

support for lost context

ncannasse 9 年之前
父節點
當前提交
970b2a177f
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      h3d/parts/GpuParticles.hx

+ 3 - 0
h3d/parts/GpuParticles.hx

@@ -619,6 +619,9 @@ class GpuParticles extends h3d.scene.MultiMaterial {
 		currentTime += ctx.elapsedTime;
 		if( prev < duration && currentTime >= duration )
 			onEnd();
+		if( primitive == null || primitive.buffer.isDisposed() )
+			for( g in groups )
+				g.needRebuild = true;
 		for( g in groups )
 			if( g.needRebuild ) {
 				rebuild(ctx.camera);