From b94edf095198ff6ab6824ec0e84366c1a3a7cb70 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Mon, 17 Mar 2025 17:00:25 +0800 Subject: [PATCH] Dart interface updates --- .../src/viewer/src/thermion_viewer_base.dart | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/thermion_dart/lib/src/viewer/src/thermion_viewer_base.dart b/thermion_dart/lib/src/viewer/src/thermion_viewer_base.dart index d9fdb603..ff922596 100644 --- a/thermion_dart/lib/src/viewer/src/thermion_viewer_base.dart +++ b/thermion_dart/lib/src/viewer/src/thermion_viewer_base.dart @@ -57,10 +57,8 @@ abstract class ThermionViewer { /// /// Render a single frame and return the captured image as a pixel buffer. /// - Future capture( - {covariant SwapChain? swapChain, - covariant View? view, - covariant RenderTarget? renderTarget}); + Future> capture( + covariant List<({View view, SwapChain? swapChain, RenderTarget? renderTarget})> targets); /// /// @@ -81,7 +79,7 @@ abstract class ThermionViewer { /// /// Future createRenderTarget( - int width, int height, int textureHandle); + int width, int height, { int? colorTextureHandle, int? depthTextureHandle }); /// /// @@ -776,22 +774,23 @@ abstract class ThermionViewer { /// /// Future createTexture(int width, int height, - {int depth = 1, int levels = 1, TextureSamplerType textureSamplerType = TextureSamplerType.SAMPLER_2D, + {int depth = 1, + int levels = 1, + TextureSamplerType textureSamplerType = TextureSamplerType.SAMPLER_2D, TextureFormat textureFormat = TextureFormat.RGBA32F}); - + /// /// /// - Future createTextureSampler({ - TextureMinFilter minFilter = TextureMinFilter.LINEAR, - TextureMagFilter magFilter = TextureMagFilter.LINEAR, - TextureWrapMode wrapS = TextureWrapMode.CLAMP_TO_EDGE, - TextureWrapMode wrapT = TextureWrapMode.CLAMP_TO_EDGE, - TextureWrapMode wrapR = TextureWrapMode.CLAMP_TO_EDGE, - double anisotropy = 0.0, - TextureCompareMode compareMode = TextureCompareMode.NONE, - TextureCompareFunc compareFunc = TextureCompareFunc.LESS_EQUAL - }); + Future createTextureSampler( + {TextureMinFilter minFilter = TextureMinFilter.LINEAR, + TextureMagFilter magFilter = TextureMagFilter.LINEAR, + TextureWrapMode wrapS = TextureWrapMode.CLAMP_TO_EDGE, + TextureWrapMode wrapT = TextureWrapMode.CLAMP_TO_EDGE, + TextureWrapMode wrapR = TextureWrapMode.CLAMP_TO_EDGE, + double anisotropy = 0.0, + TextureCompareMode compareMode = TextureCompareMode.NONE, + TextureCompareFunc compareFunc = TextureCompareFunc.LESS_EQUAL}); /// /// Decodes the specified image data. @@ -803,7 +802,6 @@ abstract class ThermionViewer { /// Future createImage(int width, int height, int channels); - /// /// /// @@ -919,7 +917,7 @@ abstract class ThermionViewer { /// /// Future setCastShadows(ThermionEntity entity, bool castShadows); - + /// /// /// @@ -934,4 +932,10 @@ abstract class ThermionViewer { /// /// Future isReceiveShadowsEnabled(ThermionEntity entity); + + /// + /// + /// + Future setClearOptions( + Vector4 clearColor, int clearStencil, bool clear, bool discard); }