support WEBGL_lose_context

This commit is contained in:
Halil Durak
2025-11-14 12:18:13 +03:00
parent 3c98e4f71e
commit f419f05a5e
3 changed files with 20 additions and 1 deletions

View File

@@ -102,4 +102,15 @@
testing.expectEqual(rendererInfo.UNMASKED_VENDOR_WEBGL, 0x9245);
testing.expectEqual(rendererInfo.UNMASKED_RENDERER_WEBGL, 0x9246);
}
// WEBGL_lose_context
{
const element = document.createElement("canvas");
const ctx = element.getContext("webgl");
const loseContext = ctx.getExtension("WEBGL_lose_context");
testing.expectEqual(true, loseContext instanceof WEBGL_lose_context);
loseContext.loseContext();
loseContext.restoreContext();
}
</script>