Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NUI.Scene3D] Add AddLight API #5854

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ internal static partial class Interop
{
internal static partial class Libraries
{
public const string Lib = "libdali2-csharp-binder.so";
public const string Scene3D = "libdali2-csharp-binder-scene3d.so";
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ internal static partial class SceneView
[global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_GetImageBasedLightScaleFactor")]
public static extern float GetImageBasedLightScaleFactor(global::System.Runtime.InteropServices.HandleRef sceneView);

// TODO : Implement AddLight API at native SceneView in future. Currently, let we just call Actor.Add
[global::System.Runtime.InteropServices.DllImport(Libraries.Lib, EntryPoint = "CSharp_Dali_Actor_Add")]
public static extern void AddLight(global::System.Runtime.InteropServices.HandleRef sceneView, global::System.Runtime.InteropServices.HandleRef light);

// TODO : Implement RemoveLight API at native SceneView in future. Currently, let we just call Actor.Remove
[global::System.Runtime.InteropServices.DllImport(Libraries.Lib, EntryPoint = "CSharp_Dali_Actor_Remove")]
public static extern void RemoveLight(global::System.Runtime.InteropServices.HandleRef sceneView, global::System.Runtime.InteropServices.HandleRef light);

[global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_UseFramebuffer")]
public static extern void UseFramebuffer(global::System.Runtime.InteropServices.HandleRef sceneView, bool useFramebuffer);

Expand Down
24 changes: 24 additions & 0 deletions src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,30 @@ public void SetImageBasedLightSource(string diffuseUrl, string specularUrl, floa
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}

/// <summary>
/// Add Lights to this SceneView.
/// </summary>
/// <param name="light">The light what we want to add</param>
// This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
[EditorBrowsable(EditorBrowsableState.Never)]
public void AddLight(Light light)
{
Interop.SceneView.AddLight(SwigCPtr, Light.getCPtr(light));
NDalicPINVOKE.ThrowExceptionIfExists();
}

/// <summary>
/// Remove Lights from this SceneView.
/// </summary>
/// <param name="light">The light what we want to remove</param>
// This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
[EditorBrowsable(EditorBrowsableState.Never)]
public void RemoveLight(Light light)
{
Interop.SceneView.RemoveLight(SwigCPtr, Light.getCPtr(light));
NDalicPINVOKE.ThrowExceptionIfExists();
}

/// <summary>
/// Sets SceneView's resolution manually.
/// </summary>
Expand Down
Loading