Back to Filament

create

docs/android/dokka/filament-android/com.google.android.filament/-engine/create.md

1.75.02.3 KB
Original Source

//filament-android/com.google.android.filament/Engine/create

create

[main]
open fun create(): Engine

Creates an instance of Engine using the default Backend

This method is one of the few thread-safe methods.

Return

A newly created Engine, or null if the GPU driver couldn't be initialized, for instance if it doesn't support the right version of OpenGL or OpenGL ES.

Throws

IllegalStateExceptioncan be thrown if there isn't enough memory to allocate the command buffer.

[main]
open fun create(backend: Engine.Backend): Engine

Creates an instance of Engine using the specified Backend

This method is one of the few thread-safe methods.

Return

A newly created Engine, or null if the GPU driver couldn't be initialized, for instance if it doesn't support the right version of OpenGL or OpenGL ES.

Parameters

main

backenddriver backend to use

Throws

IllegalStateExceptioncan be thrown if there isn't enough memory to allocate the command buffer.

[main]
open fun create(sharedContext: Any): Engine

Creates an instance of Engine using the OPENGL and a shared OpenGL context.

This method is one of the few thread-safe methods.

Return

A newly created Engine, or null if the GPU driver couldn't be initialized, for instance if it doesn't support the right version of OpenGL or OpenGL ES.

Parameters

main

sharedContextA platform-dependant OpenGL context used as a shared context when creating filament's internal context. On Android this parameter must be an instance of android.opengl.EGLContext.

Throws

IllegalStateExceptioncan be thrown if there isn't enough memory to allocate the command buffer.