createTexture method

Texture? createTexture(
  1. StorageMode storageMode,
  2. int width,
  3. int height, {
  4. PixelFormat format = PixelFormat.r8g8b8a8UNormInt,
  5. dynamic sampleCount = 1,
  6. TextureCoordinateSystem coordinateSystem = TextureCoordinateSystem.renderToTexture,
  7. bool enableRenderTargetUsage = true,
  8. bool enableShaderReadUsage = true,
  9. bool enableShaderWriteUsage = false,
})

Allocates a new texture in GPU-resident memory.

Returns null if the Texture creation failed.

Implementation

Texture? createTexture(StorageMode storageMode, int width, int height,
    {PixelFormat format = PixelFormat.r8g8b8a8UNormInt,
    sampleCount = 1,
    TextureCoordinateSystem coordinateSystem =
        TextureCoordinateSystem.renderToTexture,
    bool enableRenderTargetUsage = true,
    bool enableShaderReadUsage = true,
    bool enableShaderWriteUsage = false}) {
  Texture result = Texture._initialize(
      this,
      storageMode,
      format,
      width,
      height,
      sampleCount,
      coordinateSystem,
      enableRenderTargetUsage,
      enableShaderReadUsage,
      enableShaderWriteUsage);
  return result.isValid ? result : null;
}