[NUI] Add SetResolution method to SceneView
authorseungho baek <sbsh.baek@samsung.com>
Thu, 30 Nov 2023 02:18:55 +0000 (11:18 +0900)
committerEunki Hong <h.pichulia@gmail.com>
Mon, 4 Dec 2023 08:12:25 +0000 (17:12 +0900)
Signed-off-by: seungho baek <sbsh.baek@samsung.com>
src/Tizen.NUI.Scene3D/src/internal/Interop/Interop.SceneView.cs
src/Tizen.NUI.Scene3D/src/public/Controls/SceneView.cs

index 5167345..2923edc 100755 (executable)
@@ -79,6 +79,18 @@ namespace Tizen.NUI.Scene3D
             [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
             public static extern bool IsUsingFramebuffer(global::System.Runtime.InteropServices.HandleRef sceneView);
 
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_SetResolution")]
+            public static extern void SetResolution(global::System.Runtime.InteropServices.HandleRef sceneView, uint width, uint height);
+
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_GetResolutionWidth")]
+            public static extern uint GetResolutionWidth(global::System.Runtime.InteropServices.HandleRef sceneView);
+
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_GetResolutionHeight")]
+            public static extern uint GetResolutionHeight(global::System.Runtime.InteropServices.HandleRef sceneView);
+
+            [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_ResetResolution")]
+            public static extern void ResetResolution(global::System.Runtime.InteropServices.HandleRef sceneView);
+
             [global::System.Runtime.InteropServices.DllImport(Libraries.Scene3D, EntryPoint = "CSharp_Dali_SceneView_SetFramebufferMultiSamplingLevel")]
             public static extern void SetFramebufferMultiSamplingLevel(global::System.Runtime.InteropServices.HandleRef sceneView, uint multiSamplingLevel);
 
index 5a34f04..27bfbdf 100755 (executable)
@@ -409,6 +409,66 @@ namespace Tizen.NUI.Scene3D
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        /// <summary>
+        /// Sets SceneView's resolution manually.
+        /// </summary>
+        /// <param name="width">The input width.</param>
+        /// <param name="height">The input height.</param>
+        /// <remarks>
+        /// This manual resolution is only available when the SceneView uses FBO for rendering by using FBO (UseFrameBuffer is true).
+        /// If the aspect ratio of input width/height is different with SceneView's aspect ratio, the rendered result is stretched to fill SceneView's area.
+        /// </remarks>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void SetResolution(uint width, uint height)
+        {
+            Interop.SceneView.SetResolution(SwigCPtr, width, height);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
+        /// Retrieves width of resolution of the SceneView.
+        /// </summary>
+        /// <remarks>
+        ///  If the SceneView not uses FBO, this method returns SceneView's width.
+        /// </remarks>
+        /// <returns> Camera currently used in SceneView as a selected Camera.</returns>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public uint GetResolutionWidth()
+        {
+            uint result = Interop.SceneView.GetResolutionWidth(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return result;
+        }
+
+        /// <summary>
+        /// Retrieves height of resolution of the SceneView.
+        /// </summary>
+        /// <remarks>
+        ///  If the SceneView not uses FBO, this method returns SceneView's height.
+        /// </remarks>
+        /// <returns> Camera currently used in SceneView as a selected Camera.</returns>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public uint GetResolutionHeight()
+        {
+            uint result = Interop.SceneView.GetResolutionHeight(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return result;
+        }
+
+        /// <summary>
+        /// Resets SceneView's resolution to the current size of SceneView.
+        /// </summary>
+        // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void ResetResolution()
+        {
+            Interop.SceneView.ResetResolution(SwigCPtr);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
         internal void SetUseFramebuffer(bool useFramebuffer)
         {
             Interop.SceneView.UseFramebuffer(SwigCPtr, useFramebuffer);