Texture constructor
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);
}