updating to last glslCanvas

pull/31/head
Patricio Gonzalez Vivo 9 years ago
parent eb123556c0
commit 6d125f7b18

@ -205,15 +205,8 @@ void main(){\n\
window.onload = function () {
loadTag();
render();
};
function render() {
billboard.setMouse(mouse)
billboard.render()
window.requestAnimFrame(render);
}
</script>
</body>
</html>

@ -156,21 +156,14 @@ void main(){\n\
};
})();
// Keep track of the mouse
var mouse = {x: 0, y: 0};
document.addEventListener('mousemove', function(e){
mouse.x = e.clientX || e.pageX;
mouse.y = e.clientY || e.pageY
}, false);
window.addEventListener("hashchange", function () {
loadFunction()
}, false);
// window.onresize = function(event) {
// if (typeof window.innerWidth != 'undefined') {
// billboard. = window.innerWidth
// };
window.onresize = function(event) {
if (typeof window.innerWidth != 'undefined') {
billboard. = window.innerWidth
};
function removeElementsByClass(className){
var elements = document.getElementsByClassName(className);
@ -231,15 +224,8 @@ float function(in float x) {\n\
}
}
function render() {
billboard.setMouse(mouse)
billboard.render()
window.requestAnimFrame(render);
}
window.onload = function () {
loadFunction();
render();
};
</script>
</body>

@ -42,7 +42,7 @@ echo '
<!-- My stuff -->
<link type="text/css" rel="stylesheet" href="'.$path.'/css/style.css">
<script type="text/javascript" src="https://rawgit.com/patriciogonzalezvivo/glslCanvas/master/build/GlslCanvas.min.js"></script>
<script type="text/javascript" src="http://localhost:8001/build/GlslCanvas.min.js"></script>
<!-- Translation -->
';
@ -56,3 +56,5 @@ echo '
<body>
';
?>
<!-- <script type="text/javascript" src="https://rawgit.com/patriciogonzalezvivo/glslCanvas/master/build/GlslCanvas.min.js"></script> -->

@ -280,15 +280,6 @@ function loadCanvas() {
}
}
function renderCanvas() {
var IDs = Object.keys(billboards);
for(var i = 0; i < IDs.length; i++){
billboards[IDs[i]].setMouse(mouse);
billboards[IDs[i]].render();
}
window.requestAnimFrame(renderCanvas);
}
function insertAfter(newElement,targetElement) {
var parent = targetElement.parentNode;
if (parent.lastChild == targetElement) {
@ -403,13 +394,6 @@ function translate() {
}
// Keep track of the mouse
var mouse = {x: 0, y: 0};
document.addEventListener('mousemove', function(e){
mouse.x = e.clientX || e.pageX;
mouse.y = e.clientY || e.pageY
}, false);
/**
* Provides requestAnimationFrame in a cross browser way.
*/
@ -441,5 +425,4 @@ window.onload = function(){
captionizeImages();
loadCanvas();
renderCanvas();
};

Loading…
Cancel
Save