Skip to content

Instantly share code, notes, and snippets.

@dannyfritz
Created October 7, 2013 01:31
Show Gist options
  • Save dannyfritz/6861325 to your computer and use it in GitHub Desktop.
Save dannyfritz/6861325 to your computer and use it in GitHub Desktop.
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['lodash'], factory);
} else {
root.amdWeb = factory(root._);
}
}(this, function (b) {
var Fond = function(options) {
this.update = function() {};
this.draw = function() {};
this.run = function() {
var lastTick = Date.now();
var draw = this.draw.bind(this);
var drawLoop = function() {
draw();
window.requestAnimationFrame(drawLoop.bind(this));
}
window.requestAnimationFrame(updateLoop.bind(this));
window.requestAnimationFrame(drawLoop.bind(this));
}
};
return Fond;
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment