Slide 21
Slide 21 text
レイヤー合成範囲(コード)
// dirtyRect: 更新すべき矩形
gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
gl.bufferData(gl.ARRAY_BUFFER, new Uint8Array([
dirtyRect.left, dirtyRect.top,
dirtyRect.right, dirtyRect.top,
dirtyRect.right, dirtyRect.bottom,
dirtyRect.left, dirtyRect.bottom,
]), gl.DYNAMIC_DRAW);
gl.enableVertexAttribArray
(this.vertexLocation
);
gl.vertexAttribPointer
(this.vertexLocation
, 2, gl.FLOAT, false, 0, 0);
gl.drawArrays(gl.TRIANGLE_FAN, 0, 4);