jagenjo/litegl.js

How to correctly handle window resizes

Closed this issue · 1 comments

I'm not sure how to correctly handle this, there has to be a better way than destroying the context and creating it again.

Thanks,

whats the problem? just change the canvas size:

gl.canvas.width = new_width;
gl.canvas.height = new_height;

also remember to set the viewport

gl.viewport(0,0,new_width,new_height);