changeset 3:4bcac064db6c draft

4th commit
author e105711 <yomitan.ie.u-ryukyu.ac.jp>
date Thu, 03 May 2012 15:42:45 +0900
parents 55702e139f69
children a22ff379000f
files webGL/DrumSimulator.html
diffstat 1 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/webGL/DrumSimulator.html	Thu May 03 00:52:06 2012 +0900
+++ b/webGL/DrumSimulator.html	Thu May 03 15:42:45 2012 +0900
@@ -62,12 +62,13 @@
     var HEIGHT = 640;
     var MODE = TITLE;
     notesArray = [];
-    var Interval = 20; 
+    var Interval = 30;
     function main(){
-    var c = document.getElementById("example");
+    c = document.getElementById("example");
     c.width = WIDTH;
     c.height = HEIGHT;
     var ctx = init();
+    framerate = new Framerate("framerate");
     l = function(){loop(ctx)};
     loadNotes();
     loadSounds();
@@ -88,6 +89,7 @@
     }
     
     function loop(ctx){ //main loop
+      framerate.snapshot();
       gameRender(ctx,MODE);
     }
 
@@ -96,12 +98,8 @@
     
     function reshape(ctx)
     {
-    var canvas = document.getElementById('example');
-    if (canvas.width == width && canvas.width == height)
-    return;
-    
-    width = canvas.width;
-    height = canvas.height;
+    width = c.width;
+    height = c.height;
     
     ctx.viewport(0, 0, width, height);
     
@@ -121,10 +119,10 @@
       MAIN MODE)S:High-hat &nbsp;&nbsp; D:Snare  &nbsp;&nbsp; F:Kick  &nbsp;&nbsp; J:Tom  &nbsp;&nbsp; K:Cymbal  &nbsp;&nbsp; SPACE:Play/Stop &nbsp;&nbsp; <!--A:AUTO PLAY<br>-->
       <!--  	AUTO PLAY)Q:Quit(Back to MAIN MODE)-->
     </font>
+    <div id="framerate"></div> 
     <canvas id="example"> 
       There is supposed to be an example drawing here, but it's not important.
     </canvas> 
-    <div id="framerate"></div> 
     <div id="console"></div> 
   </body> 
 </html>