Back to Filament

setFrameCompletedCallback

docs/android/dokka/filament-android/com.google.android.filament/-swap-chain/set-frame-completed-callback.md

1.75.01.1 KB
Original Source

//filament-android/com.google.android.filament/SwapChain/setFrameCompletedCallback

setFrameCompletedCallback

[main]
open fun setFrameCompletedCallback(handler: Any, callback: Runnable)

FrameCompletedCallback is a callback function that notifies an application when a frame's contents have completed rendering on the GPU.

Use setFrameCompletedCallback to set a callback on an individual SwapChain. Each time a frame completes GPU rendering, the callback will be called.

Warning: Only Filament's Metal backend supports frame callbacks. Other backends ignore the callback (which will never be called) and proceed normally.

Parameters

main

handlerA Executor.
callbackThe Runnable callback to invoke.