Package-level declarations

Types

Link copied to clipboard
expect object Callbacks

Kotlin lambdas behind C callbacks. Pass register's result as the C userData and userOnly or argUser as the function pointer; the lambda receives the callback's leading pointer argument (or NullPointer). A once callback frees itself after firing; release the others.

actual object Callbacks

Kotlin lambdas behind C callbacks. Pass register's result as the C userData and userOnly or argUser as the function pointer; the lambda receives the callback's leading pointer argument (or NullPointer). A once callback frees itself after firing; release the others.

actual object Callbacks

Kotlin lambdas behind C callbacks. Pass register's result as the C userData and userOnly or argUser as the function pointer; the lambda receives the callback's leading pointer argument (or NullPointer). A once callback frees itself after firing; release the others.

actual object Callbacks

Kotlin lambdas behind C callbacks. Pass register's result as the C userData and userOnly or argUser as the function pointer; the lambda receives the callback's leading pointer argument (or NullPointer). A once callback frees itself after firing; release the others.

Link copied to clipboard
expect annotation class ExternalSymbolName(val name: String)

The C symbol a common external fun binds to (@SymbolName on Kotlin/Native, absent elsewhere).

actual typealias ExternalSymbolName = SymbolName

The C symbol a common external fun binds to (@SymbolName on Kotlin/Native, absent elsewhere).

Link copied to clipboard
expect class InteropScope

Hands Kotlin arrays to C for the duration of one call: pinned on Native, copied into native memory (and back with fromInterop) on JVM, Android and web. Empty and null arrays map to NullPointer. Use through interopScope or the usePinned helpers.

actual class InteropScope

Hands Kotlin arrays to C for the duration of one call: pinned on Native, copied into native memory (and back with fromInterop) on JVM, Android and web. Empty and null arrays map to NullPointer. Use through interopScope or the usePinned helpers.

actual class InteropScope

Hands Kotlin arrays to C for the duration of one call: pinned on Native, copied into native memory (and back with fromInterop) on JVM, Android and web. Empty and null arrays map to NullPointer. Use through interopScope or the usePinned helpers.

actual class InteropScope

Hands Kotlin arrays to C for the duration of one call: pinned on Native, copied into native memory (and back with fromInterop) on JVM, Android and web. Empty and null arrays map to NullPointer. Use through interopScope or the usePinned helpers.

Link copied to clipboard
expect class NativePointer

Address of a native object: Long on JVM, Android and Native; a wasm32 address (Int) on web.

actual typealias NativePointer = Long
typealias NativePointer = Long

Address of a native object: Long on JVM, Android and Native; a wasm32 address (Int) on web.

actual typealias NativePointer = Long
typealias NativePointer = Long

Address of a native object: Long on JVM, Android and Native; a wasm32 address (Int) on web.

actual typealias NativePointer = Int
typealias NativePointer = Int

Address of a native object: Long on JVM, Android and Native; a wasm32 address (Int) on web.

Link copied to clipboard
class Upload(val ptr: NativePointer, val size: Int, val callback: NativePointer, val userData: NativePointer)

size bytes of an array handed to an asynchronous set*Buffer/setImage: pass all four fields to the C call. Filament's release callback drops the copy (unpins on Native), then runs the upload's onRelease.

Properties

Link copied to clipboard
actual val NullPointer: NativePointer = 0
actual val NullPointer: NativePointer = 0
actual val NullPointer: NativePointer = 0
Link copied to clipboard

True on web: wasm has no threads, so nothing may block waiting on Filament's driver.

actual val singleThreaded: Boolean = false

True on web: wasm has no threads, so nothing may block waiting on Filament's driver.

actual val singleThreaded: Boolean = false

True on web: wasm has no threads, so nothing may block waiting on Filament's driver.

actual val singleThreaded: Boolean = true

True on web: wasm has no threads, so nothing may block waiting on Filament's driver.

Functions

Link copied to clipboard
inline fun <T> interopScope(block: InteropScope.() -> T): T
Link copied to clipboard
expect fun FloatArray.readF32(index: Int): Float

Element index of a float array C filled in. On js a FloatArray keeps the raw f32 value (0.7f reads back as 0.699999988), so this returns the shortest decimal with the same f32 value; elsewhere it's just get.

actual fun FloatArray.readF32(index: Int): Float

Element index of a float array C filled in. On js a FloatArray keeps the raw f32 value (0.7f reads back as 0.699999988), so this returns the shortest decimal with the same f32 value; elsewhere it's just get.

actual fun FloatArray.readF32(index: Int): Float

Element index of a float array C filled in. On js a FloatArray keeps the raw f32 value (0.7f reads back as 0.699999988), so this returns the shortest decimal with the same f32 value; elsewhere it's just get.

actual fun FloatArray.readF32(index: Int): Float

Element index of a float array C filled in. On js a FloatArray keeps the raw f32 value (0.7f reads back as 0.699999988), so this returns the shortest decimal with the same f32 value; elsewhere it's just get.

Link copied to clipboard
expect fun readFloats(ptr: NativePointer, count: Int): FloatArray

A copy of count floats of an array C owns (math mirrors: a const FilaMat4f* is 16 per matrix).

actual fun readFloats(ptr: NativePointer, count: Int): FloatArray

A copy of count floats of an array C owns (math mirrors: a const FilaMat4f* is 16 per matrix).

actual fun readFloats(ptr: NativePointer, count: Int): FloatArray

A copy of count floats of an array C owns (math mirrors: a const FilaMat4f* is 16 per matrix).

actual fun readFloats(ptr: NativePointer, count: Int): FloatArray

A copy of count floats of an array C owns (math mirrors: a const FilaMat4f* is 16 per matrix).

Link copied to clipboard
expect fun readInts(ptr: NativePointer, count: Int): IntArray

A copy of count ints of an array C owns (a borrowed const FilaEntity*).

actual fun readInts(ptr: NativePointer, count: Int): IntArray

A copy of count ints of an array C owns (a borrowed const FilaEntity*).

actual fun readInts(ptr: NativePointer, count: Int): IntArray

A copy of count ints of an array C owns (a borrowed const FilaEntity*).

actual fun readInts(ptr: NativePointer, count: Int): IntArray

A copy of count ints of an array C owns (a borrowed const FilaEntity*).

Link copied to clipboard
expect fun readPointers(ptr: NativePointer, count: Int): List<NativePointer>

A copy of count pointers of an array C owns (T* const*, const char* const*).

actual fun readPointers(ptr: NativePointer, count: Int): List<NativePointer>

A copy of count pointers of an array C owns (T* const*, const char* const*).

actual fun readPointers(ptr: NativePointer, count: Int): List<NativePointer>

A copy of count pointers of an array C owns (T* const*, const char* const*).

actual fun readPointers(ptr: NativePointer, count: Int): List<NativePointer>

A copy of count pointers of an array C owns (T* const*, const char* const*).

Link copied to clipboard

Reads a NUL-terminated UTF-8 string returned by C, or null for NullPointer.

Reads a NUL-terminated UTF-8 string returned by C, or null for NullPointer.

Reads a NUL-terminated UTF-8 string returned by C, or null for NullPointer.

Reads a NUL-terminated UTF-8 string returned by C, or null for NullPointer.

Link copied to clipboard

A NUL-terminated UTF-8 copy of string for a const char* parameter; null stays NullPointer.

Link copied to clipboard
expect fun upload(data: ByteArray, size: Int, onRelease: () -> Unit?): Upload
actual fun upload(data: ByteArray, size: Int, onRelease: () -> Unit?): Upload
actual fun upload(data: ByteArray, size: Int, onRelease: () -> Unit?): Upload
actual fun upload(data: ByteArray, size: Int, onRelease: () -> Unit?): Upload
Link copied to clipboard
inline fun <R> String?.useCString(block: (NativePointer) -> R): R

Calls block with a const char* copy of this string, valid for the call.

Link copied to clipboard
inline fun <R> ByteArray.usePinned(block: (NativePointer) -> R): R
inline fun <R> DoubleArray.usePinned(block: (NativePointer) -> R): R
inline fun <R> FloatArray.usePinned(block: (NativePointer) -> R): R
inline fun <R> IntArray.usePinned(block: (NativePointer) -> R): R
inline fun <R> LongArray.usePinned(block: (NativePointer) -> R): R
inline fun <R> ShortArray.usePinned(block: (NativePointer) -> R): R