[Tizen] Add Light for Scene3D 20/296920/2
authorseungho baek <sbsh.baek@samsung.com>
Mon, 12 Jun 2023 04:45:49 +0000 (13:45 +0900)
committerseungho baek <sbsh.baek@samsung.com>
Wed, 23 Aug 2023 04:52:55 +0000 (13:52 +0900)
Change-Id: Ie4da7d1878143769426a50ea9d315aafde4346d7
Signed-off-by: seungho baek <sbsh.baek@samsung.com>
dali-csharp-binder/file.list
dali-csharp-binder/src/light-wrap.cpp [new file with mode: 0644]

index a79b025..9c4486c 100755 (executable)
@@ -86,6 +86,7 @@ SET( dali_csharp_binder_tizen_wearable_src_files
 
 # module: scene3d
 SET( dali_csharp_binder_scene3d_src_files
+  ${dali_csharp_binder_dir}/src/light-wrap.cpp
   ${dali_csharp_binder_dir}/src/material-wrap.cpp
   ${dali_csharp_binder_dir}/src/model-primitive-wrap.cpp
   ${dali_csharp_binder_dir}/src/model-node-wrap.cpp
diff --git a/dali-csharp-binder/src/light-wrap.cpp b/dali-csharp-binder/src/light-wrap.cpp
new file mode 100644 (file)
index 0000000..858cabd
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali-scene3d/public-api/light/light.h>
+
+// INTERNAL INCLUDES
+#include "common.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Light_New_SWIG_0()
+{
+  Dali::Scene3D::Light result;
+
+  {
+    try
+    {
+      result = Dali::Scene3D::Light::New();
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return new Dali::Scene3D::Light((const Dali::Scene3D::Light&)result);
+}
+
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_Light_SWIG_0()
+{
+  Dali::Scene3D::Light* result = 0;
+
+  {
+    try
+    {
+      result = (Dali::Scene3D::Light*)new Dali::Scene3D::Light();
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return (void*)result;
+}
+
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_Light_SWIG_1(void* csLight)
+{
+  Dali::Scene3D::Light* light  = (Dali::Scene3D::Light*)csLight;
+  Dali::Scene3D::Light* result = 0;
+
+  if(!light)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Scene3D::Light const & type is null", 0);
+    return 0;
+  }
+  {
+    try
+    {
+      result = (Dali::Scene3D::Light*)new Dali::Scene3D::Light((Dali::Scene3D::Light const&)*light);
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return (void*)result;
+}
+
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_Light(void* csLight)
+{
+  Dali::Scene3D::Light* light = (Dali::Scene3D::Light*)csLight;
+  {
+    try
+    {
+      delete light;
+    }
+    CALL_CATCH_EXCEPTION();
+  }
+}
+
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Light_Assign(void* csDestination, void* csSource)
+{
+  Dali::Scene3D::Light* destination = (Dali::Scene3D::Light*)csDestination;
+  Dali::Scene3D::Light* source      = (Dali::Scene3D::Light*)csSource;
+  Dali::Scene3D::Light* result      = 0;
+
+  if(!source)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Scene3D::Light const & type is null", 0);
+    return 0;
+  }
+  {
+    try
+    {
+      result = (Dali::Scene3D::Light*)&(destination)->operator=((Dali::Scene3D::Light const&)*source);
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return (void*)result;
+}
+
+SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Light_DownCast(void* csHandle)
+{
+  Dali::BaseHandle*    handle = (Dali::BaseHandle*)csHandle;
+  Dali::Scene3D::Light result;
+
+  if(!handle)
+  {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Light", 0);
+    return 0;
+  }
+  {
+    try
+    {
+      result = Dali::Scene3D::Light::DownCast(*handle);
+    }
+    CALL_CATCH_EXCEPTION(0);
+  }
+
+  return new Dali::Scene3D::Light((const Dali::Scene3D::Light&)result);
+}
+
+SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Light_Enable(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->Enable(enable);
+  }
+  CALL_CATCH_EXCEPTION();
+}
+
+SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Light_IsEnabled(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->IsEnabled();
+  }
+  CALL_CATCH_EXCEPTION(0);
+
+  return result;
+}
+
+SWIGEXPORT uint32_t SWIGSTDCALL CSharp_Dali_SceneView_GetMaximumEnabledLightCount()
+{
+  uint32_t result = 0u;
+  try
+  {
+    result = static_cast<uint32_t>(Dali::Scene3D::Light::GetMaximumEnabledLightCount());
+  }
+  CALL_CATCH_EXCEPTION(0);
+  return result;
+}
+
+#ifdef __cplusplus
+}
+#endif