Back to Filament

onFrame

docs/android/dokka/filament-android/com.google.android.filament.android/-choreographer-helper/on-frame.md

1.75.01.4 KB
Original Source

//filament-android/com.google.android.filament.android/ChoreographerHelper/onFrame

onFrame

[main]
open fun onFrame(frameTimeNanos: Long)

Base callback invoked when a new frame should be rendered.

In Inheritance Mode, subclasses should override this method if they do not require FrameData.

In Composition Mode, this delegates to the attached onFrame.

Parameters

main

frameTimeNanosMonotonic timestamp of the frame in nanoseconds.

[main]
open fun onFrame(frameTimeNanos: Long, frameData: Any)

Main callback invoked when a new frame should be rendered, providing optional payload telemetry.

In Inheritance Mode, subclasses can override this method to receive Android 13+ FrameData.

In Composition Mode, this delegates to the attached onFrame.

Parameters

main

frameTimeNanosMonotonic timestamp of the frame in nanoseconds.
frameDataOptional Choreographer.FrameData instance on Android 13+ (API 33). Passed as an Object to avoid verification failures on older API levels.