I'm curious, I have a question what happens if C2 uses webGL to resize canvas from small to big in fullscreen to get smoother gameplay using this:
var canvas;
var gl;
function resizeCanvas() {
// only change the size of the canvas if the size it's being displayed
// has changed.
if (canvas.width != canvas.clientWidth ||
canvas.height != canvas.clientHeight) {
// Change the size of the canvas to match the size it's being displayed
canvas.width = canvas.clientWidth;
canvas.height = canvas.clientHeight;
}
}
function main() {
canvas = document.getElementById("c");
gl = canvas.getContext("experimental-webgl");
resizeCanvas();
...
// at render time
gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);
}
window.addEventListener('load', main);
window.addEventListener('resize' resizeCanvas);
I took this code from stack overflow, if is not related to webGL framebuffer to canvas, then silly me.
When I see C2 game is using traditional canvas when I try to resize from fullscreen window to small, the performance changes like 45 fps to 60 fps in debugger.
I thought about the bigger the canvas, the worse the performance, I think webGL uses a framebuffer the size and then interpolate it to a larger canvas. It's about my theory.
Is it possible?