Published: 11 May 2018 › Updated: 11 May 2018
Webgl and Typescript Guide 1. | Lets Clear
In the following Github example, init webgl, the clearing, size in html, pixels in canvas.
Init Webgl:
canvas.getContext("webgl2");
Clear:
gl.clearColor(1.0,0.0,0.0,1.0);
this.clear(this.COLOR_BUFFER_BIT | this.DEPTH_BUFFER_BIT);
Size in html:
this.canvas.style.width = width;
this.canvas.style.height = height;
Pixels in Canvas:
this.viewport(0, 0, width, height);
The result is:
Leave Webgl and Typescript Guide 1. | Lets Clear to:
Read more #guide posts
Best Posts From lonzo23
We have not curated any of lonzo23's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.