mirror of
https://github.com/greggman/twgl.js.git
synced 2026-02-01 16:00:22 +00:00
update samples to use bindFramebufferInfo
This commit is contained in:
parent
b5f778f878
commit
147b61ce2e
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user