ImageTexture constructor

ImageTexture(
  1. ChronosGL cgl,
  2. String url,
  3. dynamic _element, [
  4. TextureProperties? tp,
  5. int textureType = GL_TEXTURE_2D,
])

Implementation

ImageTexture(ChronosGL cgl, String url, this._element,
    [TextureProperties? tp, int textureType = GL_TEXTURE_2D])
    : super(cgl, textureType, url, tp == null ? TextureProperties() : tp) {
  _cgl.bindTexture(_textureType, _texture);

  properties.InstallEarly(_cgl, _textureType);
  SetImageData(_element);
  properties.InstallLate(_cgl, _textureType);
  int err = _cgl.getError();
  assert(err == GL_NO_ERROR);
  _cgl.bindTexture(_textureType, null);
}