Windows embedder fixes

This commit is contained in:
Nick Fisher
2024-10-14 11:23:56 +11:00
parent 1135ba054c
commit f9468db266
11 changed files with 91 additions and 59 deletions

View File

@@ -142,6 +142,17 @@ external void Viewer_setViewRenderable(
bool renderable,
);
@ffi.Native<
ffi.Void Function(ffi.Pointer<TViewer>, ffi.Pointer<ffi.Char>, ffi.Float,
ffi.Pointer<ffi.NativeFunction<ffi.Void Function()>>)>(isLeaf: true)
external void Viewer_loadIblRenderThread(
ffi.Pointer<TViewer> viewer,
ffi.Pointer<ffi.Char> iblPath,
double intensity,
ffi.Pointer<ffi.NativeFunction<ffi.Void Function()>> onComplete,
);
@ffi.Native<
ffi.Void Function(
ffi.Pointer<TViewer>,

View File

@@ -360,7 +360,12 @@ class ThermionViewerFFI extends ThermionViewer {
Future loadIbl(String lightingPath, {double intensity = 30000}) async {
final pathPtr =
lightingPath.toNativeUtf8(allocator: allocator).cast<Char>();
load_ibl(_viewer!, pathPtr, intensity);
await withVoidCallback((cb) {
Viewer_loadIblRenderThread(_viewer!, pathPtr, intensity, cb);
});
}
///