The program won’t do a simple color buffer clear, canvas remains white instead of green . It shows no errors, COLOR_CLEAR_VALUE keeps returning 3106.I’m using typescript with Vite.
function render(){
canvas.width=canvas.clientWidth;
canvas.height=canvas.clientHeight;
gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
gl.clearColor(0.0, 1.0, 0.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT);
console.log(gl.COLOR_CLEAR_VALUE)
requestAnimationFrame(render);
}
requestAnimationFrame(render);`
“
New contributor
aname is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.