ProceduralTexture class abstract base

A texture generated in code.

An abstraction rather than a set of free functions returning ByteData, so that "which texture" is a value the demo can hold and the upload path is written once. upload is the only place that touches the GPU, which keeps encode testable on its own. base: extend it, do not implement it. See Shape for the reasoning — it is the same one, and it is why a texture added to this contract later costs nobody a recompile.

Implementers

Constructors

ProceduralTexture()
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
Edge length in pixels; procedural textures here are square.
no setter

Methods

encode() ByteData
RGBA8 pixels, row-major from the top-left.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
upload(GraphicsDevice device) TextureHandle
Uploads the pixels through device.

Operators

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