]> git.codecow.com Git - nano-pow.git/commitdiff
Check if context loss is immediately available.
authorChris Duncan <chris@zoso.dev>
Thu, 2 Apr 2026 21:27:42 +0000 (14:27 -0700)
committerChris Duncan <chris@zoso.dev>
Thu, 2 Apr 2026 21:27:42 +0000 (14:27 -0700)
test/index.html

index 1fe9c80bc592edd4d4636dd0263d3019bdf8934f..bd56d014b4baa8262e77e66064f0633dd00b05e1 100644 (file)
@@ -45,6 +45,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
                                        console.log('NanoPow test page WebGL context restored during glSize()', ev.statusMessage)
                                })
                                const gl = canvas.getContext('webgl2')
+                               console.log('gl.isContextLost()', gl.isContextLost())
                                const MAX_VIEWPORT_DIMS = gl.getParameter(gl.MAX_VIEWPORT_DIMS)
                                canvas.height = MAX_VIEWPORT_DIMS?.[0] ?? 0x1000
                                canvas.width = MAX_VIEWPORT_DIMS?.[1] ?? 0x1000