await

suspend fun <T : Renderable, B : Renderable.Builder<T, B>> Renderable.Builder<T, B>.await(engine: Engine): T

Awaits for loading a Renderable with the parameters of the builder without blocking a thread.

This suspending function is cancellable. If the Job of the current coroutine is cancelled or completed while this suspending function is waiting, this function stops waiting for the completion stage and immediately resumes with CancellationException. This method is intended to be used with one-shot futures, so on coroutine cancellation the CompletableFuture that corresponds to this CompletionStage (see CompletionStage.toCompletableFuture) is cancelled. If cancelling the given stage is undesired, stage.asDeferred().await() should be used instead.

Return

the created directional light

See also

KTXLoader.loadEnvironment
HDRLoader.loadEnvironment