GraphicsDevice class

The GraphicsDevice provides a way for developers to interact with the GPU by binding different resources to it.

A frame starts with begin and ends with end. Within a frame, one or more render passes can be created with beginPass/endPass, each producing an Image.

Constructors

GraphicsDevice({Color clearValue = const Color(0x00000000), GpuBackend? backend})
The GraphicsDevice provides a way for developers to interact with the GPU by binding different resources to it.

Properties

backend GpuBackend
The GPU backend this device records its rendering commands through.
final
blendState BlendState
Blend state applied to each render pass.
getter/setter pair
clearValue Color
The clear value, used to clear out the screen.
final
depthStencilState DepthStencilState
Depth/stencil state applied to each render pass.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

begin() → void
Begin a new frame.
beginPass(Size size) → void
Begin a render pass at the given size.
bindGeometry(Surface surface) → void
Bind a surface's geometry (vertex/index buffers) and draw.
bindPipeline(GpuPipeline pipeline, CullMode cullMode) → void
Bind a render pipeline with the given cullMode.
bindTexture(GpuUniformSlot slot, Texture texture) → void
Bind a uniform slot to the texture.
bindUniform(GpuUniformSlot slot, ByteBuffer buffer) → void
Bind a uniform slot to the data in buffer.
clearBindings() → void
Clear all resources bound to the current render pass.
end() → void
End the frame.
endPass() Image
Submit the render pass to the GPU and return the rendered Image.
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