allocateTextureUnit method

int allocateTextureUnit()

Implementation

int allocateTextureUnit() {
  int textureUnit = textureUnits;

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

  textureUnits += 1;

  return textureUnit;
}