Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

activeTexture method

Specifies the active texture unit.

IE11

 

Syntax

WebGLRenderingContext.activeTexture(texture);

Parameters

texture [in]

Type: Number

The texture unit to make active. Value is gl.TEXTUREi where i is in the range from 0 to gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS -1.

Return value

This method does not return a value.

Remarks

WebGL errorDescription
gl.INVALID_ENUMTexture isn't in the format of gl.TEXTUREi where i is within the range from 0 to gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS -1.

 

Examples


<body>
  <canvas id="canvas"></canvas>
  ...
<script>
  // Get the context
  var gl = document.getElementById("canvas").getContext("experimental-webgl");
  ... 
  // Set the active texture
  gl.activeTexture(texture);

See also

WebGLRenderingContext

 

 

Show:
© 2015 Microsoft