Randomblue
Randomblue

Reputation: 116413

WebGL texture: second time load sizing is wrong

I have a WebGL canvas in which I load two images as textures. For each texture load, I first resize the canvas to the image size, so that the image is not distorted.

Despite the resizing, the second texture is distorted. Please see this fiddle.

Upvotes: 1

Views: 111

Answers (1)

Randomblue
Randomblue

Reputation: 116413

Figured it out. One needs to use the gl.viewport function.

Upvotes: 2

Related Questions