mozilla

Revision 414295 of WebGLRenderingContext

  • Revision slug: Web/API/WebGLRenderingContext
  • Revision title: WebGLRenderingContext
  • Revision id: 414295
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment Web/WebGL/WebGLRenderingContext Web/API/WebGLRenderingContext

Revision Content

{{ gecko_minversion_header("2") }}{{ draft() }}

Summary

WebGLRenderingContext objects expose the WebGLRenderingContext interface, the principal interface in WebGL which provides special properties and methods to manipulate the 3D content rendered in an HTML canvas element.

Properties

Note: This list is NOT complete.
Todo: document the properties defined by this interface

Name Type Description
canvas
drawingBufferWidth
drawingBufferHeight

Constants

Note: This list is NOT complete.
Todo: document the constants defined by this interface

Constant Value Description
FRAGMENT_SHADER    
VERTEX_SHADER    
COMPILE_STATUS    
DELETE_STATUS    
LINK_STATUS    
VALIDATE_STATUS    
ATTACHED_SHADERS    
ACTIVE_ATTRIBUTES    
ACTIVE_UNIFORMS    
POINTS    
LINE_STRIP    
LINE_LOOP    
LINES    
TRIANGLE_STRIP    
TRIANGLE_FAN    
TRIANGLES    
STATIC_DRAW    
STREAM_DRAW    
DYNAMIC_DRAW    
ARRAY_BUFFER    
ELEMENT_ARRAY_BUFFER    
COLOR_BUFFER_BIT    
DEPTH_BUFFER_BIT    
STENCIL_BUFFER_BIT    
NEVER    
ALWAYS    
LESS    
EQUAL    
LEQUAL    
GREATER    
GEQUAL    
NOTEQUAL    
BLEND    
CULL_FACE    
DEPTH_TEST    
DITHER    
POLYGON_OFFSET_FILL    
SAMPLE_ALPHA_TO_COVERAGE    
SAMPLE_COVERAGE    
SCISSOR_TEST    
STENCIL_TEST    

Methods

Todo: document the methods defined by this interface

Browser support

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{ CompatVersionUnknown() }} {{ CompatGeckoDesktop('2.0') }} {{ CompatNo() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }}
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}

See also

Revision Source

<p>{{ gecko_minversion_header("2") }}{{ draft() }}</p>
<h2 id="Summary">Summary</h2>
<p>WebGLRenderingContext objects expose the <code><a class="external" href="http://www.khronos.org/registry/webgl/specs/latest/#5.14" rel="external nofollow" target="_blank" title="http://www.khronos.org/registry/webgl/specs/latest/#5.14">WebGLRenderingContext</a></code> interface, the principal interface in WebGL which provides special properties and methods to manipulate the 3D content rendered in an HTML&nbsp;<a class="internal" href="/en/HTML/Canvas" title="en/HTML/Canvas"><code>canvas</code></a> element.</p>
<h2 id="Properties" name="Properties">Properties</h2>
<p>Note: This list is NOT complete.<br />Todo: document the properties defined by this interface</p>
<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>canvas</code></td>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <td><code>drawingBufferWidth</code></td>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <td><code>drawingBufferHeight</code></td>
      <td></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h2>Constants</h2>
<p>Note: This list is NOT complete.<br />Todo: document the constants defined by this interface</p>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Constant</th>
      <th scope="col">Value</th>
      <th scope="col">Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>FRAGMENT_SHADER</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>VERTEX_SHADER</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>COMPILE_STATUS</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>DELETE_STATUS</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>LINK_STATUS</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>VALIDATE_STATUS</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>ATTACHED_SHADERS</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>ACTIVE_ATTRIBUTES</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>ACTIVE_UNIFORMS</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>POINTS</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>LINE_STRIP</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>LINE_LOOP</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>LINES</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>TRIANGLE_STRIP</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>TRIANGLE_FAN</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>TRIANGLES</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>STATIC_DRAW</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>STREAM_DRAW</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>DYNAMIC_DRAW</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>ARRAY_BUFFER</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>ELEMENT_ARRAY_BUFFER</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>COLOR_BUFFER_BIT</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>DEPTH_BUFFER_BIT</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>STENCIL_BUFFER_BIT</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>NEVER</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>ALWAYS</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>LESS</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>EQUAL</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>LEQUAL</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>GREATER</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>GEQUAL</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>NOTEQUAL</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>BLEND</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>CULL_FACE</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>DEPTH_TEST</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>DITHER</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>POLYGON_OFFSET_FILL</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>SAMPLE_ALPHA_TO_COVERAGE</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>SAMPLE_COVERAGE</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>SCISSOR_TEST</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td><code>STENCIL_TEST</code></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </tbody>
</table>
<h2 id="Methods">Methods</h2>
<p>Todo: document the methods defined by this interface</p>
<h2 id="Browser_support">Browser support</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatGeckoDesktop('2.0') }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Chrome for Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
  <li><a href="/en/WebGL" title="WebGL">WebGL</a></li>
  <li><a href="/en/WebGL/Getting_started_with_WebGL" title="Getting_started_with_WebGL">Getting started with WebGL</a></li>
  <li><a href="/en/WebGL/Creating_3D_objects_using_WebGL" title="Creating 3D objects using WebGL">Creating 3D objects using WebGL</a></li>
</ul>
Revert to this revision