Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a 'webglcontextchanged' event #2338

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion specs/latest/1.0/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3195,7 +3195,8 @@ <h3><a name="WEBGLCONTEXTEVENT">WebGLContextEvent</a></h3>
WebGL rendering context. Events are sent using the DOM Event System <a href="#refsDOM3EVENTS">[DOM3EVENTS]</a>,
and are dispatched to the HTMLCanvasElement associated with the WebGL rendering context.
The types of status changes that can trigger a <code>WebGLContextEvent</code> event are <a href="#CONTEXT_LOST">
the loss of the context</a>, <a href="#CONTEXT_RESTORED">the restoration of the context</a>, and
the loss of the context</a>, <a href="#CONTEXT_RESTORED">the restoration of the context</a>,
<a href="#CONTEXT_CHANGED">a significant change in the system GPU's capabilities</a>, and
<a href="#CONTEXT_CREATION_ERROR"> the inability to create a context</a>.
</p>
<p>
Expand Down Expand Up @@ -3379,6 +3380,42 @@ <h4><a name="CONTEXT_RESTORED">The Context Restored Event</a></h4>
initializeGame();</pre>
</div>

<h4><a name="CONTEXT_CHANGED">The Context Changed Event</a></h4>

<p>
When the user agent detects that the capabilities of the
<code>WebGLRenderingContext</code> <em>context</em> have been significantly changed
by the system, such as parameters indicating the maximum values the
context supports, it must run the following steps:

<ol class="nestedlist">

<li> Let <em>canvas</em> be the <em>context's</em>
<a href="#context-canvas">canvas</a>. </li>

<li> <a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">Queue a task</a> to
perform the following step:

<ol class="nestedlist">

<li> <a href="#fire-a-webgl-context-event">Fire a WebGL context event</a> named
"webglcontextchanged" at <em>canvas</em>, with its <code>statusMessage</code> attribute set
to "". </li>

</ol>

</li>
</ol>
</p>

<div class="note">
This event is designed to be mostly informative, and usually only applicable to content
that has tested and exceeded the minimum requirements for some context limits. In this
case, on a system with multiple GPUs, if the underlying GPU that a context is using
is changed by the system to one that is less capable, the content may need to
reset itself for the new limits. The majority of content will not need to handle this event.
</div>

<h4><a name="CONTEXT_CREATION_ERROR">The Context Creation Error Event</a></h4>

<p>
Expand Down