From 1876056f63a0f1b5492ab76139e14fc072535387 Mon Sep 17 00:00:00 2001 From: Kento Date: Sun, 20 Nov 2011 10:32:44 -0800 Subject: [PATCH] added delay before shader compilation is triggered, to reduce mid-edit compiles. --- static/index.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/static/index.html b/static/index.html index 08eae48..e9abadc 100644 --- a/static/index.html +++ b/static/index.html @@ -165,7 +165,7 @@ // Greetings to Iq/RGBA! ;) var quality = 2, quality_levels = [ 0.5, 1, 2, 4, 8 ]; - var toolbar, compileButton, fullscreenButton; + var toolbar, compileButton, fullscreenButton, compileTimer; var code, canvas, gl, buffer, currentProgram, vertexPosition, parameters = { startTime: Date.now(), time: 0, mouseX: 0.5, mouseY: 0.5, screenWidth: 0, screenHeight: 0 }, frontTarget, backTarget, screenProgram; @@ -214,8 +214,9 @@ if ( event.keyCode == 38 ) return; if ( event.keyCode == 39 ) return; if ( event.keyCode == 40 ) return; - - compile(); + + clearTimeout(compileTimer); + compileTimer = setTimeout(compile, 500); }, false );