topical media & game development
mobile-query-three-plugins-statsplus-examples-index.htm / htm
<!doctype html><title>Minimal tQuery Page</title>
<!-- <script src="http://benvanik.github.com/WebGL-Inspector/core/embed.js"></script>
-->
<script src="../../../build/tquery-bundle.js"></script>
<script src="../../statsplus/statsmemory.js"></script>
<script src="../../statsplus/statsdelay.js"></script>
<script src="../../statsplus/statsthreejswebgl.js"></script>
<script src="../../statsplus/tquery.statsplus.js"></script>
<body onload='onLoad()'>
<script>
// load by require.js to get the timer ? doesnt seems to work
function onLoad(){
var world = tQuery.createWorld().boilerplate().start();
for(var i = 0; i < 10; i++){
var object = tQuery.createTorus().addTo(world);
object.positionX(Math.random()*2-1)
object.positionY(Math.random()*2-1)
object.positionZ(Math.random()*2-1)
}
world.enableStatsPlus();
// How to handle autoscaling
// - important for stuff for memory or other measure which can grow a lot
// - store all the values currently visible
// - there is a min and a max among those values
// - update the scale IIF new value wouldnt be visible
// - updating scale implies to redraw every column
// should i pass to canvas2d ?
// - more flexible
// - currently only limited to one histo per gfx
// - i could do more with canvas2d
// - visu ala example-pause
// generate plenty of objects
// from example-pause.html in generation GC from firefox
var garbage = [];
var garbageSize = 1024 * 1024 * 6;
var garbageIdx = 0;
function makeGarbage(amount){
for(var i = 0; i < amount; i++){
//garbage[garbageIdx] = new Object();
garbage[garbageIdx] = {};
garbageIdx = (garbageIdx+1) % garbageSize;
}
}
world.loop().hook(function(){
makeGarbage(1024)
})
}
</script></body>
(C) Æliens
04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.