setFrameCompletedCallback

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "silent no-op — `filament.js` does not bind setFrameCompletedCallback, and OpenGLDriver implements it as an empty function, so it could not fire on WebGL either.")
actual fun setFrameCompletedCallback(callback: () -> Unit?)

Sets a callback to be invoked when a frame's rendering has completed on the GPU.

The callback is called after the frame has been fully rendered on the GPU. On the default handler, this is guaranteed to be called on the main Filament thread.

Use this callback to be notified when GPU rendering is finished, useful for synchronization or performance monitoring.

Only the Metal backend supports this callback. Every other backend accepts it and never calls it. (This is not true of setFrameScheduledCallback, which fires on all of them.)

Parameters

callback

The callback function to invoke when frame GPU rendering completes. Pass null or a no-op function to unset the callback.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "silent no-op — `filament.js` does not bind setFrameCompletedCallback, and OpenGLDriver implements it as an empty function, so it could not fire on WebGL either.")
expect fun setFrameCompletedCallback(callback: () -> Unit? = null)

Sets a callback to be invoked when a frame's rendering has completed on the GPU.

The callback is called after the frame has been fully rendered on the GPU. On the default handler, this is guaranteed to be called on the main Filament thread.

Use this callback to be notified when GPU rendering is finished, useful for synchronization or performance monitoring.

Only the Metal backend supports this callback. Every other backend accepts it and never calls it. (This is not true of setFrameScheduledCallback, which fires on all of them.)

Parameters

callback

The callback function to invoke when frame GPU rendering completes. Pass null or a no-op function to unset the callback.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "silent no-op — `filament.js` does not bind setFrameCompletedCallback, and OpenGLDriver implements it as an empty function, so it could not fire on WebGL either.")
actual fun setFrameCompletedCallback(callback: () -> Unit?)

Sets a callback to be invoked when a frame's rendering has completed on the GPU.

The callback is called after the frame has been fully rendered on the GPU. On the default handler, this is guaranteed to be called on the main Filament thread.

Use this callback to be notified when GPU rendering is finished, useful for synchronization or performance monitoring.

Only the Metal backend supports this callback. Every other backend accepts it and never calls it. (This is not true of setFrameScheduledCallback, which fires on all of them.)

Parameters

callback

The callback function to invoke when frame GPU rendering completes. Pass null or a no-op function to unset the callback.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "silent no-op — `filament.js` does not bind setFrameCompletedCallback, and OpenGLDriver implements it as an empty function, so it could not fire on WebGL either.")
actual fun setFrameCompletedCallback(callback: () -> Unit?)

Sets a callback to be invoked when a frame's rendering has completed on the GPU.

The callback is called after the frame has been fully rendered on the GPU. On the default handler, this is guaranteed to be called on the main Filament thread.

Use this callback to be notified when GPU rendering is finished, useful for synchronization or performance monitoring.

Only the Metal backend supports this callback. Every other backend accepts it and never calls it. (This is not true of setFrameScheduledCallback, which fires on all of them.)

Parameters

callback

The callback function to invoke when frame GPU rendering completes. Pass null or a no-op function to unset the callback.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "silent no-op — `filament.js` does not bind setFrameCompletedCallback, and OpenGLDriver implements it as an empty function, so it could not fire on WebGL either.")
actual fun setFrameCompletedCallback(callback: () -> Unit?)

Sets a callback to be invoked when a frame's rendering has completed on the GPU.

The callback is called after the frame has been fully rendered on the GPU. On the default handler, this is guaranteed to be called on the main Filament thread.

Use this callback to be notified when GPU rendering is finished, useful for synchronization or performance monitoring.

Only the Metal backend supports this callback. Every other backend accepts it and never calls it. (This is not true of setFrameScheduledCallback, which fires on all of them.)

Parameters

callback

The callback function to invoke when frame GPU rendering completes. Pass null or a no-op function to unset the callback.