I want to have a fairly large number of HTML canvas
that I draw on using WebGL. But if I draw more than 8 or 16 or a similar, client-dependent number, earlier ones disappear.
Based on the WebGL wiki I thought that reacting on webglcontextlost
and webglcontextrestored
would fix this… but it does not seem to be the case.
I essentially tried this code:
canvas.addEventListener('webglcontextlost', e => {
e.preventDefault();
});
canvas.addEventListener('webglcontextrestored', e => {
render();
});
with full fiddle available.
Do I have a coding error, or a conceptual error?