allocateTextureUnit method

int allocateTextureUnit()

Implementation

int allocateTextureUnit() {
  int textureUnit = textureUnits;

  if (textureUnit >= maxTextures) {
    console.warning('WebGLTextures: Trying to use $textureUnit texture units while this GPU supports only $maxTextures');
  }

  textureUnits += 1;

  return textureUnit;
}