A view of a World: a render worker on its own thread that draws the world each time frame is called. Every view shares one GPU device, and a world's views share its meshes and textures, so a second view of a world costs only its own frames. HeadlessView reads the pixels back; AppleView and AndroidSurfaceView draw for Flutter to show.
- Implemented types
- Implementers
Properties
- address → int
-
The native view, for the platform plugins' calls. A plugin must stop
using it before dispose.
no setter
- camera ↔ Camera?
-
The camera the view draws from: its own, or the world's main one
(World.camera) when null. Read at each frame. While its object
isn't a live, shown object of the world (not added yet, destroyed,
inactive), the view draws black, not the main camera's picture.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → int
-
The height the frames from the next frame on are drawn at, in
pixels.
no setter
- isDisposed → bool
-
Whether dispose was called; then frame, resize, stats and
the rest of its calls throw a StateError.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stats → ViewStats
-
What the view did since it was made, and the GPU memory it holds
now. Subtract an earlier one for the counts in between.
no setter
- width → int
-
The width the frames from the next frame on are drawn at, in pixels.
no setter
Methods
-
dispose(
) → void - Stops the render worker (after the frame it's drawing) and frees the view. Calling it again does nothing.
-
frame(
) → int - Copies the world and hands it to the render worker, without waiting for the GPU. Returns the frame's number (1, 2, …).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
releaseImages(
) → void - Lets go of the images the view draws through (its shadow maps and the pictures its effects work on), for when memory is short and the view isn't drawing. The render thread does it soon after, with no frame needed. The next frame makes them again, for the same picture, so doing this while drawing only costs a slow frame.
-
resize(
int width, int height) → void -
Draws the frames from the next frame on at
width×heightpixels. Frames already on their way finish at the old size and are never shown. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- timeGpu ↔ bool
-
Whether every view's frames are timed on the GPU, each part of a frame
on its own, into ViewStats.gpu: for measuring, off by default.
Timing costs a little GPU time, and on Apple GPUs keeps some driver
memory in use. Where the GPU can't time its work nothing is timed.
getter/setter pair