update samples to use bindFramebufferInfo

This commit is contained in:
Gregg Tavares 2015-11-08 17:08:55 +09:00
parent b5f778f878
commit 147b61ce2e
2 changed files with 6 additions and 12 deletions

View File

@ -283,12 +283,10 @@ void main() {
var aspect;
if (useFramebuffer) {
gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferInfo.framebuffer);
gl.viewport(0, 0, fbSize, fbSize);
twgl.bindFramebufferInfo(gl, framebufferInfo);
aspect = 1;
} else {
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);
twgl.bindFramebufferInfo(gl, null);
aspect = gl.canvas.clientWidth / gl.canvas.clientHeight;
}
@ -350,8 +348,7 @@ void main() {
}
if (useFramebuffer) {
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);
twgl.bindFramebufferInfo(gl, null);
gl.clearColor(0, 0, 0, 0);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);

View File

@ -283,12 +283,10 @@ void main() {
var aspect;
if (useFramebuffer) {
gl.bindFramebuffer(gl.FRAMEBUFFER, framebufferInfo.framebuffer);
gl.viewport(0, 0, fbSize, fbSize);
twgl.bindFramebufferInfo(gl, framebufferInfo);
aspect = 1;
} else {
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);
twgl.bindFramebufferInfo(gl, null);
aspect = gl.canvas.clientWidth / gl.canvas.clientHeight;
}
@ -351,8 +349,7 @@ void main() {
}
if (useFramebuffer) {
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);
twgl.bindFramebufferInfo(gl, null);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
gl.cullFace(gl.FRONT);