[NUI] Add GLWindow Rendering mode
authorWonsik Jung <sidein@samsung.com>
Wed, 28 Apr 2021 10:34:41 +0000 (19:34 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Fri, 21 May 2021 07:37:43 +0000 (16:37 +0900)
Add GLWindow rendering mode.
It has two mode as continuous and on demand.
If the mode is continuous, the rendering user callback is called continuously.
If the mode is on demand, the rendering user callback is called by call renderOnce().

src/Tizen.NUI/src/internal/Interop/Interop.GLWindow.cs
src/Tizen.NUI/src/public/Common/NUIConstants.cs
src/Tizen.NUI/src/public/Window/GLWindow.cs

index eec4fd9..e22e385 100755 (executable)
@@ -110,6 +110,12 @@ namespace Tizen.NUI
             [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_RenderOnce")]
             public static extern void GlWindowRenderOnce(HandleRef jarg1);
 
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_GetRenderingMode")]
+            public static extern int GlWindowGetRenderingMode(HandleRef jarg1);
+
+            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_SetRenderingMode")]
+            public static extern void GlWindowSetRenderingMode(HandleRef jarg1, int jarg2);
+
             [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_GlWindow_SWIGUpcast")]
             public static extern global::System.IntPtr GlWindowUpcast(global::System.IntPtr jarg1);
 
index 5847844..0d87747 100755 (executable)
@@ -1885,4 +1885,49 @@ namespace Tizen.NUI
     {
         public readonly static string ResourcePath = "/usr/share/dotnet.tizen/framework/res/";
     }
+
+    /// <summary>
+    /// This Enumeration is used the GLES version for EGL configuration.<br />
+    /// If the device can not support GLES version 3.0 over, the version will be chosen with GLES version 2.0.<br />
+    /// It is for GLWindow and GLView.<br />
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public enum GLESVersion
+    {
+      /// <summary>
+      /// GLES version 2.0
+      /// </summary>
+      [EditorBrowsable(EditorBrowsableState.Never)]
+      Version20 = 0,
+
+      /// <summary>
+      /// GLES version 3.0
+      /// </summary>
+      [EditorBrowsable(EditorBrowsableState.Never)]
+      Version30
+    }
+
+    /// <summary>
+    /// Enumeration for rendering mode
+    /// This Enumeration is used to choose the rendering mode.
+    /// It has two options.
+    /// One of them is continuous mode. It is rendered continuously.
+    /// The other is on demand mode. It is rendered by application.
+    /// It is for GLWindow and GLView.
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public enum GLRenderingMode
+    {
+      /// <summary>
+      /// continuous mode
+      /// </summary>
+      [EditorBrowsable(EditorBrowsableState.Never)]
+      Continuous = 0,
+
+      /// <summary>
+      /// on demand by application
+      /// </summary>
+      [EditorBrowsable(EditorBrowsableState.Never)]
+      OnDemand = 1
+    }
 }
index ba84d01..a2a7f8e 100755 (executable)
@@ -136,26 +136,6 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// This Enumeration is used the GLES version for EGL configuration.<br />
-        /// If the device can not support GLES version 3.0 over, the version will be chosen with GLES version 2.0<br />
-        /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public enum GLESVersion
-        {
-            /// <summary>
-            /// GLES version 2.0
-            /// </summary>
-            [EditorBrowsable(EditorBrowsableState.Never)]
-            Version_2_0 = 0,
-
-            /// <summary>
-            /// GLES version 3.0
-            /// </summary>
-            [EditorBrowsable(EditorBrowsableState.Never)]
-            Version_3_0
-        }
-
-        /// <summary>
         /// Sets egl configuration for GLWindow
         /// </summary>
         /// <param name="depth">The flag of depth buffer. If true is set, 24bit depth buffer is enabled.</param>
@@ -495,6 +475,27 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Gets or sets a Rendeirng Mode of GLWindow.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public GLRenderingMode RenderingMode
+        {
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            get
+            {
+                GLRenderingMode mode = (GLRenderingMode)Interop.GLWindow.GlWindowGetRenderingMode(SwigCPtr);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
+                return mode;
+            }
+            [EditorBrowsable(EditorBrowsableState.Never)]
+            set
+            {
+                Interop.GLWindow.GlWindowSetRenderingMode(SwigCPtr, (int)value);
+                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+        }
+
+        /// <summary>
         /// Dispose for Window
         /// </summary>
         protected override void Dispose(DisposeTypes type)