AppleView class final

A view that draws a World into IOSurfaces for Flutter to show on macOS and iOS. package:fynkel_flutter's FynkelView makes one and hands address and the function addresses to its Swift plugin; a game never uses it directly. It must be disposed: an Apple view left for the garbage collector stays allocated, with its render worker.

Inheritance

Constructors

AppleView(World world, {required int width, required int height})
Throws a FynkelException with FynkelStatus.unsupported off Apple.

Properties

address → int
The native view, for the platform plugins' calls. A plugin must stop using it before dispose.
no setterinherited
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 pairinherited
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 setterinherited
isDisposed → bool
Whether dispose was called; then frame, resize, stats and the rest of its calls throw a StateError.
no setterinherited
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 setterinherited
width → int
The width the frames from the next frame on are drawn at, in pixels.
no setterinherited

Methods

dispose() → void
Stops the render worker (after the frame it's drawing) and frees the view. Calling it again does nothing.
inherited
frame() → int
Copies the world and hands it to the render worker, without waiting for the GPU. Returns the frame's number (1, 2, …).
inherited
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.
inherited
resize(int width, int height) → void
Draws the frames from the next frame on at width × height pixels. Frames already on their way finish at the old size and are never shown.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

acquireAddress → int
fy_apple_acquire, for Flutter's raster thread.
no setter
freeAddress → int
fy_view_free, for the plugin to free the views of an isolate that is gone (a hot restart disposes nothing).
no setter
setFrameReadyAddress → int
fy_apple_set_frame_ready, for the plugin to learn of new frames.
no setter