GpuBackend class abstract base

A rendering backend: the abstraction over a concrete low-level GPU API.

flame_3d talks to the GPU exclusively through this interface, so the same rendering code can run on different platforms.

Exactly one backend is active at a time, reachable via instance. Each GpuBackend implementation sets the instance at construction time through it's super constructor.

Constructors

GpuBackend()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

beginFrame() → GpuFrame
Begins a new frame.
createBuffer({required GpuStorageMode storageMode, required int sizeInBytes}) → GpuBuffer
Creates a GpuBuffer of sizeInBytes bytes.
createPipeline({required GpuShader vertexShader, required GpuShader fragmentShader}) → GpuPipeline
Links vertexShader and fragmentShader into a GpuPipeline.
createRenderTarget({required int width, required int height, required Color clearValue}) → GpuRenderTarget
Creates a GpuRenderTarget of widthxheight, cleared to clearValue at the start of each pass.
createTexture({required GpuStorageMode storageMode, required int width, required int height, required GpuPixelFormat format}) → GpuTexture
Creates a GpuTexture.
loadShaderLibrary(String assetName) → GpuShaderLibrary
Loads a GpuShaderLibrary from the asset at assetName.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

instance → GpuBackend
The active backend.
no setter

Static Methods

initialize() → Future<void>
Initialize the GpuBackend.