add destroy_swap_chain_ffi and move setRendering into its own task
This commit is contained in:
@@ -17,6 +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 destroy_swap_chain_ffi(void* const viewer);
|
||||
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);
|
||||
|
||||
@@ -72,7 +72,12 @@ public:
|
||||
|
||||
void setRendering(bool rendering)
|
||||
{
|
||||
_rendering = rendering;
|
||||
std::packaged_task<void()> lambda([&]() mutable
|
||||
{
|
||||
this->_rendering = rendering;
|
||||
});
|
||||
auto fut = add_task(lambda);
|
||||
fut.wait();
|
||||
}
|
||||
|
||||
void doRender()
|
||||
@@ -143,6 +148,17 @@ extern "C"
|
||||
fut.wait();
|
||||
}
|
||||
|
||||
FLUTTER_PLUGIN_EXPORT void destroy_swap_chain_ffi(void* const viewer)
|
||||
{
|
||||
Log("Destroying swapchain");
|
||||
std::packaged_task<void()> lambda([&]() mutable
|
||||
{
|
||||
destroy_swap_chain(viewer);
|
||||
});
|
||||
auto fut = _rl->add_task(lambda);
|
||||
fut.wait();
|
||||
}
|
||||
|
||||
FLUTTER_PLUGIN_EXPORT void create_render_target_ffi(void* const viewer, intptr_t nativeTextureId, uint32_t width, uint32_t height)
|
||||
{
|
||||
std::packaged_task<void()> lambda([&]() mutable
|
||||
|
||||
Reference in New Issue
Block a user