2017-03-15 01:07:58 +00:00
|
|
|
var TextWebGLRenderer = function (renderer, src, interpolationPercentage, camera)
|
|
|
|
{
|
|
|
|
if (this.renderMask !== this.renderFlags)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-03-21 21:06:36 +00:00
|
|
|
if (src.dirty)
|
|
|
|
{
|
2017-03-21 23:14:25 +00:00
|
|
|
var w = src.canvas.width;
|
|
|
|
var h = src.canvas.height;
|
|
|
|
var resize = !(src.prevWidth < w || src.prevHeight < h);
|
|
|
|
|
|
|
|
src.canvasTexture = renderer.uploadCanvasToGPU(src.canvas, src.canvasTexture, resize);
|
|
|
|
src.prevWidth = w;
|
|
|
|
src.prevHeight = h;
|
2017-03-21 21:06:36 +00:00
|
|
|
src.dirty = false;
|
|
|
|
}
|
|
|
|
|
2017-03-30 12:48:24 +00:00
|
|
|
renderer.spriteBatch.addSpriteTexture(src, camera, src.canvasTexture, src.prevWidth, src.prevHeight);
|
2017-03-15 01:07:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = TextWebGLRenderer;
|