Refactor render. Disabling WebGL render for now.

This commit is contained in:
Gunther Brunner
2014-11-12 18:40:35 +09:00
parent 87de3cfb8d
commit 2fdcf8243c
3 changed files with 389 additions and 383 deletions

View File

@@ -0,0 +1,20 @@
function CanvasRender(canvasElement, options) {
this.options = options
this.context = canvasElement.getContext('2d')
}
CanvasRender.prototype.draw = function (image) {
this.context.drawImage(image, 0, 0)
}
CanvasRender.prototype.clear = function () {
this.context.clearRect(0, 0, this.context.canvas.width,
this.context.canvas.height)
}
// Check for Non CommonJS world
if (typeof module !== 'undefined') {
module.exports = {
CanvasRender: CanvasRender
}
}