From: seungho baek Date: Wed, 30 Aug 2023 12:47:22 +0000 (+0900) Subject: Wrapping for Shadow api for a Directional Light X-Git-Tag: dali_2.2.42~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a3e11f2f6a1f861a7ed3e62d622bcfbb739c917;p=platform%2Fcore%2Fuifw%2Fdali-csharp-binder.git Wrapping for Shadow api for a Directional Light Change-Id: I778db11618cef035a600450a2f04f48eeb04f71e Signed-off-by: seungho baek --- diff --git a/dali-csharp-binder/dali-scene3d/light-wrap.cpp b/dali-csharp-binder/dali-scene3d/light-wrap.cpp index 68f156f1..f471db75 100644 --- a/dali-csharp-binder/dali-scene3d/light-wrap.cpp +++ b/dali-csharp-binder/dali-scene3d/light-wrap.cpp @@ -168,7 +168,7 @@ SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Light_IsEnabled(void* csLight) return result; } -SWIGEXPORT uint32_t SWIGSTDCALL CSharp_Dali_SceneView_GetMaximumEnabledLightCount() +SWIGEXPORT uint32_t SWIGSTDCALL CSharp_Dali_Light_GetMaximumEnabledLightCount() { uint32_t result = 0u; try @@ -179,6 +179,154 @@ SWIGEXPORT uint32_t SWIGSTDCALL CSharp_Dali_SceneView_GetMaximumEnabledLightCoun return result; } +SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Light_EnableShadow(void* csLight, bool enable) +{ + Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight; + + if(!light) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0); + return; + } + + try + { + light->EnableShadow(enable); + } + CALL_CATCH_EXCEPTION(); +} + +SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Light_IsShadowEnabled(void* csLight) +{ + Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight; + bool result; + + if(!light) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0); + return false; + } + + try + { + result = light->IsShadowEnabled(); + } + CALL_CATCH_EXCEPTION(0); + + return result; +} + +SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Light_EnableShadowSoftFiltering(void* csLight, bool enable) +{ + Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight; + + if(!light) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0); + return; + } + + try + { + light->EnableShadowSoftFiltering(enable); + } + CALL_CATCH_EXCEPTION(); +} + +SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Light_IsShadowSoftFilteringEnabled(void* csLight) +{ + Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight; + bool result; + + if(!light) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0); + return false; + } + + try + { + result = light->IsShadowSoftFilteringEnabled(); + } + CALL_CATCH_EXCEPTION(0); + + return result; +} + +SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Light_SetShadowIntensity(void* csLight, float shadowIntensity) +{ + Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight; + + if(!light) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0); + return; + } + + try + { + light->SetShadowIntensity(shadowIntensity); + } + CALL_CATCH_EXCEPTION(); +} + +SWIGEXPORT float SWIGSTDCALL CSharp_Dali_Light_GetShadowIntensity(void* csLight) +{ + float result = 0.0f; + + Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight; + + if(!light) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0); + return 0.0f; + } + + try + { + result = light->GetShadowIntensity(); + } + CALL_CATCH_EXCEPTION(0); + return result; +} + +SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Light_SetShadowBias(void* csLight, float shadowBias) +{ + Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight; + + if(!light) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0); + return; + } + + try + { + light->SetShadowBias(shadowBias); + } + CALL_CATCH_EXCEPTION(); +} + +SWIGEXPORT float SWIGSTDCALL CSharp_Dali_Light_GetShadowBias(void* csLight) +{ + float result = 0.0f; + + Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight; + + if(!light) + { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0); + return 0.0f; + } + + try + { + result = light->GetShadowBias(); + } + CALL_CATCH_EXCEPTION(0); + return result; +} + #ifdef __cplusplus } #endif