Expand Minimize

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