From c3764df4e20300ea513765e461ffba62cb7235dc Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Wed, 23 Oct 2024 02:25:06 +1100 Subject: [PATCH] feat: (flutter) (windows) add DestroyRenderingSurface method --- .../windows/thermion_flutter_plugin.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/thermion_flutter/thermion_flutter/windows/thermion_flutter_plugin.cpp b/thermion_flutter/thermion_flutter/windows/thermion_flutter_plugin.cpp index edc57452..251b9836 100644 --- a/thermion_flutter/thermion_flutter/windows/thermion_flutter_plugin.cpp +++ b/thermion_flutter/thermion_flutter/windows/thermion_flutter_plugin.cpp @@ -83,7 +83,7 @@ ResourceBuffer ThermionFlutterPlugin::loadResource(const char *name) { TCHAR pBuf[512]; size_t len = sizeof(pBuf); - int bytes = GetModuleFileName(NULL, pBuf, len); + int bytes = GetModuleFileName(NULL, pBuf, static_cast(len)); std::wstring_convert> converter; std::wstring assetPath = converter.from_bytes(name_str.c_str()); @@ -190,16 +190,9 @@ void ThermionFlutterPlugin::CreateTexture( void ThermionFlutterPlugin::DestroyTexture( const flutter::MethodCall &methodCall, std::unique_ptr> result) { - - const auto *flutterTextureId = std::get_if(methodCall.arguments()); - - if (!flutterTextureId) { - result->Error("NOT_IMPLEMENTED", "Flutter texture ID must be provided"); - return; - } if (_context) { - _context->DestroyTexture(std::move(result)); + _context->DestroyRenderingSurface(std::move(result)); } else { result->Error("NO_CONTEXT", "No rendering context is active");