Skip to content

Commit 9b281b2

Browse files
committed
Update restoreContext too
1 parent 68ff83c commit 9b281b2

2 files changed

Lines changed: 9 additions & 18 deletions

File tree

files/en-us/web/api/webgl_lose_context/losecontext/index.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ browser-compat: api.WEBGL_lose_context.loseContext
88

99
{{APIRef("WebGL")}}
1010

11-
The **WEBGL_lose_context.loseContext()** method is part of the [WebGL API](/en-US/docs/Web/API/WebGL_API) and allows you to simulate losing the context of a {{domxref("WebGLRenderingContext")}} context.
11+
The **`loseContext()`** method of the `WEBGL_lose_context` extension is part of the [WebGL API](/en-US/docs/Web/API/WebGL_API) and allows you to simulate losing the context of a {{domxref("WebGLRenderingContext")}}.
1212

13-
It triggers the steps described in the WebGL specification for handling context lost. The context will remain lost until {{domxref("WEBGL_lose_context.restoreContext()")}} is called. It also destroys the underlying graphics context and all graphics resources. This is the recommended mechanism for applications to programmatically halt their use of the WebGL API.
13+
It triggers the [steps described in the WebGL specification](https://registry.khronos.org/webgl/specs/latest/1.0/#5.15.2) for handling context lost. The context will remain lost until {{domxref("WEBGL_lose_context.restoreContext()")}} is called. It also destroys the underlying graphics context and all graphics resources. This is the recommended mechanism for applications to programmatically halt their use of the WebGL API.
1414

1515
## Syntax
1616

@@ -28,9 +28,7 @@ None ({{jsxref("undefined")}}).
2828

2929
## Examples
3030

31-
With this method, you can simulate the
32-
[`webglcontextlost`](/en-US/docs/Web/API/HTMLCanvasElement/webglcontextlost_event)
33-
event:
31+
With this method, you can simulate the [`webglcontextlost`](/en-US/docs/Web/API/HTMLCanvasElement/webglcontextlost_event) event:
3432

3533
```js
3634
const canvas = document.getElementById("canvas");
@@ -56,7 +54,4 @@ gl.getExtension("WEBGL_lose_context").loseContext();
5654
## See also
5755

5856
- {{domxref("WebGLRenderingContext.isContextLost()")}}
59-
- Events:
60-
[`webglcontextlost`](/en-US/docs/Web/API/HTMLCanvasElement/webglcontextlost_event),
61-
[`webglcontextrestored`](/en-US/docs/Web/API/HTMLCanvasElement/webglcontextrestored_event),
62-
[`webglcontextcreationerror`](/en-US/docs/Web/API/HTMLCanvasElement/webglcontextcreationerror_event)
57+
- Events: [`webglcontextlost`](/en-US/docs/Web/API/HTMLCanvasElement/webglcontextlost_event), [`webglcontextrestored`](/en-US/docs/Web/API/HTMLCanvasElement/webglcontextrestored_event), [`webglcontextcreationerror`](/en-US/docs/Web/API/HTMLCanvasElement/webglcontextcreationerror_event)

files/en-us/web/api/webgl_lose_context/restorecontext/index.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ browser-compat: api.WEBGL_lose_context.restoreContext
88

99
{{APIRef("WebGL")}}
1010

11-
The **WEBGL_lose_context.restoreContext()** method is part of the [WebGL API](/en-US/docs/Web/API/WebGL_API) and allows you to simulate
12-
restoring the context of a {{domxref("WebGLRenderingContext")}} object.
11+
The **`restoreContext()`** method of the `WEBGL_lose_context` extension is part of the [WebGL API](/en-US/docs/Web/API/WebGL_API) and allows you to simulate restoring the context of a {{domxref("WebGLRenderingContext")}}.
12+
13+
It triggers the [steps described in the WebGL specification](https://registry.khronos.org/webgl/specs/latest/1.0/#5.15.3) for handling context restored. The context is not usable until the {{domxref("HTMLCanvasElement.webglcontextrestored_event", "webglcontextrestored")}} event is fired.
1314

1415
## Syntax
1516

@@ -34,9 +35,7 @@ Browsers may not report WebGL errors by default. WebGL's error reporting works b
3435

3536
## Examples
3637

37-
With this method, you can simulate the
38-
[`webglcontextrestored`](/en-US/docs/Web/API/HTMLCanvasElement/webglcontextrestored_event)
39-
event:
38+
With this method, you can simulate the [`webglcontextrestored`](/en-US/docs/Web/API/HTMLCanvasElement/webglcontextrestored_event) event:
4039

4140
```js
4241
const canvas = document.getElementById("canvas");
@@ -60,7 +59,4 @@ gl.getExtension("WEBGL_lose_context").restoreContext();
6059
## See also
6160

6261
- {{domxref("WebGLRenderingContext.isContextLost()")}}
63-
- Events:
64-
[`webglcontextlost`](/en-US/docs/Web/API/HTMLCanvasElement/webglcontextlost_event),
65-
[`webglcontextrestored`](/en-US/docs/Web/API/HTMLCanvasElement/webglcontextrestored_event),
66-
[`webglcontextcreationerror`](/en-US/docs/Web/API/HTMLCanvasElement/webglcontextcreationerror_event)
62+
- Events: [`webglcontextlost`](/en-US/docs/Web/API/HTMLCanvasElement/webglcontextlost_event), [`webglcontextrestored`](/en-US/docs/Web/API/HTMLCanvasElement/webglcontextrestored_event), [`webglcontextcreationerror`](/en-US/docs/Web/API/HTMLCanvasElement/webglcontextcreationerror_event)

0 commit comments

Comments
 (0)