draw = {
init(viewof options.value.size);
vertexBuffer;
const _canvas = DOM.canvas(gl.canvas.width, gl.canvas.height);
return (options = {}) => {
const {
month = 0,
latitude = .5,
rotation = 0,
size = 400,
canvas = _canvas
} = options;
if(gl.canvas.width != size || gl.canvas.height != size) {
init(size);
}
const rotate = [rotation * 2 * Math.PI, latitude * Math.PI];
gl.uniform2fv(u_rotate, rotate);
gl.bindTexture(gl.TEXTURE_2D, textures[month]);
gl.drawArrays(gl.TRIANGLE_FAN, 0, 4);
if(canvas.width != size || canvas.height != size) {
canvas.width = canvas.height = size;
}
canvas.getContext('2d').drawImage(gl.canvas, 0, 0);
return canvas;
}
}