John Salamon il y a 7 ans
Parent
commit
3ce025446a
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      code.js

+ 5 - 0
code.js

@@ -161,6 +161,11 @@ let startGL = function(img) {
 	requestId = window.requestAnimationFrame(render);
 	function render(t) {
 
+		if(pause) {
+			requestId = window.requestAnimationFrame(render);
+			return;
+		}
+
 		gl.viewport(0, 0, img.width, img.height);
 
 		// swap which texture is being rendered to each frame