diff --git a/ios/include/PolyvoxFilamentFFIApi.h b/ios/include/PolyvoxFilamentFFIApi.h index f52ef5c9..78a024b2 100644 --- a/ios/include/PolyvoxFilamentFFIApi.h +++ b/ios/include/PolyvoxFilamentFFIApi.h @@ -17,7 +17,7 @@ typedef void (*FilamentRenderCallback)(void* const owner); FLUTTER_PLUGIN_EXPORT void* const create_filament_viewer_ffi(void* const context, void* const platform, const char* uberArchivePath, const ResourceLoaderWrapper* const loader, void (*renderCallback)(void* const renderCallbackOwner), void* const renderCallbackOwner); FLUTTER_PLUGIN_EXPORT void create_swap_chain_ffi(void* const viewer, void* const surface, uint32_t width, uint32_t height); -FLUTTER_PLUGIN_EXPORT void create_render_target_ffi(void* const viewer, uint32_t nativeTextureId, uint32_t width, uint32_t height); +FLUTTER_PLUGIN_EXPORT void create_render_target_ffi(void* const viewer, intptr_t nativeTextureId, uint32_t width, uint32_t height); FLUTTER_PLUGIN_EXPORT void destroy_filament_viewer_ffi(void* const viewer); FLUTTER_PLUGIN_EXPORT void render_ffi(void* const viewer); FLUTTER_PLUGIN_EXPORT FilamentRenderCallback make_render_callback_fn_pointer(FilamentRenderCallback); @@ -84,8 +84,7 @@ FLUTTER_PLUGIN_EXPORT void get_animation_name_ffi(void* const assetManager, Enti FLUTTER_PLUGIN_EXPORT void get_morph_target_name_ffi(void* const assetManager, EntityId asset, const char *meshName, char *const outPtr, int index); FLUTTER_PLUGIN_EXPORT int get_morph_target_name_count_ffi(void* const assetManager, EntityId asset, const char *meshName); FLUTTER_PLUGIN_EXPORT void set_post_processing_ffi(void* const viewer, bool enabled); -FLUTTER_PLUGIN_EXPORT EntityId pick(int x, int y); - +FLUTTER_PLUGIN_EXPORT void pick_ffi(void* const viewer, int x, int y, EntityId* entityId); FLUTTER_PLUGIN_EXPORT void ios_dummy_ffi(); #ifdef __cplusplus diff --git a/ios/src/PolyvoxFilamentFFIApi.cpp b/ios/src/PolyvoxFilamentFFIApi.cpp index cf4ef280..b65631ca 100644 --- a/ios/src/PolyvoxFilamentFFIApi.cpp +++ b/ios/src/PolyvoxFilamentFFIApi.cpp @@ -143,7 +143,7 @@ extern "C" fut.wait(); } - FLUTTER_PLUGIN_EXPORT void create_render_target_ffi(void* const viewer, uint32_t nativeTextureId, uint32_t width, uint32_t height) + FLUTTER_PLUGIN_EXPORT void create_render_target_ffi(void* const viewer, intptr_t nativeTextureId, uint32_t width, uint32_t height) { std::packaged_task lambda([&]() mutable { create_render_target(viewer, nativeTextureId, width, height); }); @@ -283,6 +283,7 @@ extern "C" auto fut = _rl->add_task(lambda); fut.wait(); } + FLUTTER_PLUGIN_EXPORT void remove_ibl_ffi(void* const viewer) { std::packaged_task lambda([&] @@ -290,6 +291,7 @@ extern "C" auto fut = _rl->add_task(lambda); fut.wait(); } + EntityId add_light_ffi(void* const viewer, uint8_t type, float colour, float intensity, float posX, float posY, float posZ, float dirX, float dirY, float dirZ, bool shadows) { std::packaged_task lambda([&] @@ -434,6 +436,14 @@ extern "C" fut.wait(); } + FLUTTER_PLUGIN_EXPORT void pick_ffi(void* const viewer, int x, int y, EntityId* entityId) { + std::packaged_task lambda([&] { + pick(viewer, x, y, entityId); + }); + auto fut = _rl->add_task(lambda); + fut.wait(); + } + FLUTTER_PLUGIN_EXPORT void ios_dummy_ffi() { Log("Dummy called"); }