From b160932ff335350bbb25774ebe67824f77907676 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Wed, 16 Apr 2025 14:00:30 +0800 Subject: [PATCH] logging --- .../viewer/src/ffi/src/ffi_filament_app.dart | 1 - .../windows/thermion_flutter_plugin.cpp | 41 +++---------------- 2 files changed, 5 insertions(+), 37 deletions(-) diff --git a/thermion_dart/lib/src/viewer/src/ffi/src/ffi_filament_app.dart b/thermion_dart/lib/src/viewer/src/ffi/src/ffi_filament_app.dart index 4a43cec4..62fdb7ae 100644 --- a/thermion_dart/lib/src/viewer/src/ffi/src/ffi_filament_app.dart +++ b/thermion_dart/lib/src/viewer/src/ffi/src/ffi_filament_app.dart @@ -148,7 +148,6 @@ class FFIFilamentApp extends FilamentApp { if (hasStencilBuffer) { flags |= TSWAP_CHAIN_CONFIG_HAS_STENCIL_BUFFER; } - print("swapchain flags $flags"); final swapChain = await withPointerCallback((cb) => Engine_createHeadlessSwapChainRenderThread( this.engine, width, height, flags, cb)); diff --git a/thermion_flutter/thermion_flutter/windows/thermion_flutter_plugin.cpp b/thermion_flutter/thermion_flutter/windows/thermion_flutter_plugin.cpp index 6fc9777b..0983860b 100644 --- a/thermion_flutter/thermion_flutter/windows/thermion_flutter_plugin.cpp +++ b/thermion_flutter/thermion_flutter/windows/thermion_flutter_plugin.cpp @@ -71,9 +71,6 @@ namespace thermion::tflutter::windows const flutter::MethodCall &methodCall, std::unique_ptr> result) { - - std::wcerr << "CreateTexture " << std::endl; - if (!_context) { _context = new thermion::windows::vulkan::ThermionVulkanContext(); @@ -171,12 +168,8 @@ namespace thermion::tflutter::windows const flutter::MethodCall &methodCall, std::unique_ptr> result) { - std::cout << methodCall.method_name().c_str() << std::endl; - if (methodCall.method_name() == "getResourceLoaderWrapper") - { - result->Success(flutter::EncodableValue((int64_t)nullptr)); - } - else if (methodCall.method_name() == "getSharedContext") + // std::cout << methodCall.method_name().c_str() << std::endl; + if (methodCall.method_name() == "getSharedContext") { if (!_context) { @@ -185,45 +178,19 @@ namespace thermion::tflutter::windows // result->Success(flutter::EncodableValue((int64_t)_context->GetSharedContext())); result->Success(flutter::EncodableValue((int64_t) nullptr)); } - else if (methodCall.method_name() == "resizeWindow") - { - - const auto *args = - std::get_if(methodCall.arguments()); - - int dWidth = *(std::get_if(&(args->at(0)))); - int dHeight = *(std::get_if(&(args->at(1)))); - int dLeft = *(std::get_if(&(args->at(2)))); - int dTop = *(std::get_if(&(args->at(3)))); - auto width = static_cast(dWidth); - auto height = static_cast(dHeight); - auto left = static_cast(dLeft); - auto top = static_cast(dTop); - - _context->ResizeRenderingSurface(width, height, left, top); - result->Success(); - } else if (methodCall.method_name() == "createTexture") { CreateTexture(methodCall, std::move(result)); } - else if (methodCall.method_name() == "createWindow") - { - CreateTexture(methodCall, std::move(result)); - } else if (methodCall.method_name() == "destroyTexture") { - DestroyTexture(methodCall, std::move(result)); - } - else if (methodCall.method_name() == "destroyWindow") - { + // result->Success(flutter::EncodableValue((int64_t) nullptr)); DestroyTexture(methodCall, std::move(result)); } else if (methodCall.method_name() == "markTextureFrameAvailable") { if (_context) { - _context->Flush(); _context->BlitFromSwapchain(); const auto *flutterTextureId = std::get_if(methodCall.arguments()); @@ -234,6 +201,8 @@ namespace thermion::tflutter::windows } // std::cout << "Marking texture" << (*flutterTextureId) << "available" << std::endl; _textureRegistrar->MarkTextureFrameAvailable(*flutterTextureId); + } else { + std::cout << "No context" << std::endl; } result->Success(flutter::EncodableValue((int64_t) nullptr)); }