Texture constructor

Texture({
  1. required GL2 gl,
  2. required WebGLTexture? texture,
  3. int width = 0,
  4. int height = 0,
  5. int flags = TextureFlags.defaultFlags,
  6. Uint8List? pixelData,
})

Creates a Texture instance, usually internally by static factory methods.

  • gl: The WebGL2 rendering context.
  • texture: The WebGL texture object.
  • width: Initial width (defaults to 0).
  • height: Initial height (defaults to 0).
  • flags: Texture flags (defaults to TextureFlags.defaultFlags).
  • pixelData: Optional initial pixel data.

Implementation

Texture({
  required GL2 gl,
  required this.texture,
  this.width = 0,
  this.height = 0,
  this.flags = TextureFlags.defaultFlags,
  Uint8List? pixelData,
}) : _gl = gl {
  this.pixelData = pixelData ?? Uint8List(0);
}