Wrapping for Shadow api for a Directional Light 44/298044/1
authorseungho baek <sbsh.baek@samsung.com>
Wed, 30 Aug 2023 12:47:22 +0000 (21:47 +0900)
committerseungho baek <sbsh.baek@samsung.com>
Wed, 30 Aug 2023 12:47:22 +0000 (21:47 +0900)
Change-Id: I778db11618cef035a600450a2f04f48eeb04f71e
Signed-off-by: seungho baek <sbsh.baek@samsung.com>
dali-csharp-binder/dali-scene3d/light-wrap.cpp

index 68f156f..f471db7 100644 (file)
@@ -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