2 * Copyright(c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.ComponentModel;
19 using Tizen.NUI.BaseComponents;
23 /// This will be released at Tizen.NET API Level 6, so currently this would be used as inhouse API.
24 [EditorBrowsable(EditorBrowsableState.Never)]
25 public class RenderTask : Animatable
27 internal RenderTask(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
31 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
33 Interop.RenderTask.DeleteRenderTask(swigCPtr);
37 public static RenderTask GetRenderTaskFromPtr(global::System.IntPtr cPtr)
39 RenderTask ret = new RenderTask(cPtr, false);
40 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
44 protected override void Dispose(DisposeTypes type)
51 foreach (var window in Application.GetWindowList())
53 window.GetRenderTaskList().RemoveTask(this);
59 internal class Property
61 internal static readonly int ViewportPosition = Interop.RenderTask.ViewportPositionGet();
62 internal static readonly int ViewportSize = Interop.RenderTask.ViewportSizeGet();
63 internal static readonly int ClearColor = Interop.RenderTask.ClearColorGet();
64 internal static readonly int RequiresSync = Interop.RenderTask.RequiresSyncGet();
67 internal static SWIGTYPE_p_f_r_Dali__Vector2__bool DEFAULT_SCREEN_TO_FRAMEBUFFER_FUNCTION
71 global::System.IntPtr cPtr = Interop.RenderTask.DefaultScreenToFramebufferFunctionGet();
72 SWIGTYPE_p_f_r_Dali__Vector2__bool ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_r_Dali__Vector2__bool(cPtr);
73 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
78 internal static SWIGTYPE_p_f_r_Dali__Vector2__bool FULLSCREEN_FRAMEBUFFER_FUNCTION
82 global::System.IntPtr cPtr = Interop.RenderTask.FullscreenFramebufferFunctionGet();
83 SWIGTYPE_p_f_r_Dali__Vector2__bool ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_r_Dali__Vector2__bool(cPtr);
84 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89 public static bool DEFAULT_EXCLUSIVE
93 bool ret = Interop.RenderTask.DefaultExclusiveGet();
94 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
99 public static bool DEFAULT_INPUT_ENABLED
103 bool ret = Interop.RenderTask.DefaultInputEnabledGet();
104 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
109 public static Vector4 DEFAULT_CLEAR_COLOR
113 global::System.IntPtr cPtr = Interop.RenderTask.DefaultClearColorGet();
114 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
115 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
120 public static bool DEFAULT_CLEAR_ENABLED
124 bool ret = Interop.RenderTask.DefaultClearEnabledGet();
125 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
130 public static bool DEFAULT_CULL_MODE
134 bool ret = Interop.RenderTask.DefaultCullModeGet();
135 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
140 public static uint DEFAULT_REFRESH_RATE
144 uint ret = Interop.RenderTask.DefaultRefreshRateGet();
145 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
150 public RenderTask() : this(Interop.RenderTask.NewRenderTask(), true)
152 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155 public static RenderTask DownCast(BaseHandle handle)
159 throw new global::System.ArgumentNullException(nameof(handle));
161 RenderTask ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as RenderTask;
162 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166 public RenderTask(RenderTask handle) : this(Interop.RenderTask.NewRenderTask(RenderTask.getCPtr(handle)), true)
168 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 public RenderTask Assign(RenderTask rhs)
173 RenderTask ret = new RenderTask(Interop.RenderTask.Assign(SwigCPtr, RenderTask.getCPtr(rhs)), false);
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
178 public void SetSourceView(View view)
180 Interop.RenderTask.SetSourceActor(SwigCPtr, View.getCPtr(view));
181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184 public View GetSourceView()
186 View ret = new View(Interop.RenderTask.GetSourceActor(SwigCPtr), true);
187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191 public void SetExclusive(bool exclusive)
193 Interop.RenderTask.SetExclusive(SwigCPtr, exclusive);
194 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197 public bool IsExclusive()
199 bool ret = Interop.RenderTask.IsExclusive(SwigCPtr);
200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204 public void SetInputEnabled(bool enabled)
206 Interop.RenderTask.SetInputEnabled(SwigCPtr, enabled);
207 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210 public bool GetInputEnabled()
212 bool ret = Interop.RenderTask.GetInputEnabled(SwigCPtr);
213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
217 [Obsolete("Do not use this. Use Tizen.NUI.Scene3D.Camera instead.")]
218 [EditorBrowsable(EditorBrowsableState.Never)]
219 public void SetCamera(Camera camera)
221 Interop.RenderTask.SetCameraActor(SwigCPtr, Camera.getCPtr(camera));
222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225 [Obsolete("Do not use this. Use Tizen.NUI.Scene3D.Camera instead.")]
226 [EditorBrowsable(EditorBrowsableState.Never)]
227 public Camera GetCamera()
229 Camera ret = new Camera(Interop.RenderTask.GetCameraActor(SwigCPtr), true);
230 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
234 public void SetFrameBuffer(FrameBuffer frameBuffer)
236 Interop.RenderTask.SetFrameBuffer(SwigCPtr, FrameBuffer.getCPtr(frameBuffer));
237 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240 public FrameBuffer GetFrameBuffer()
242 FrameBuffer ret = new FrameBuffer(Interop.RenderTask.GetFrameBuffer(SwigCPtr), true);
243 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
247 internal void SetScreenToFrameBufferFunction(SWIGTYPE_p_f_r_Dali__Vector2__bool conversionFunction)
249 Interop.RenderTask.SetScreenToFrameBufferFunction(SwigCPtr, SWIGTYPE_p_f_r_Dali__Vector2__bool.getCPtr(conversionFunction));
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 internal SWIGTYPE_p_f_r_Dali__Vector2__bool GetScreenToFrameBufferFunction()
255 global::System.IntPtr cPtr = Interop.RenderTask.GetScreenToFrameBufferFunction(SwigCPtr);
256 SWIGTYPE_p_f_r_Dali__Vector2__bool ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_r_Dali__Vector2__bool(cPtr);
257 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261 public void SetScreenToFrameBufferMappingView(View mappingView)
263 Interop.RenderTask.SetScreenToFrameBufferMappingActor(SwigCPtr, View.getCPtr(mappingView));
264 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
267 public View GetScreenToFrameBufferMappingView()
269 View ret = new View(Interop.RenderTask.GetScreenToFrameBufferMappingActor(SwigCPtr), true);
270 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
274 public void SetViewportPosition(Vector2 position)
276 Interop.RenderTask.SetViewportPosition(SwigCPtr, Vector2.getCPtr(position));
277 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
280 public Vector2 GetCurrentViewportPosition()
282 Vector2 ret = new Vector2(Interop.RenderTask.GetCurrentViewportPosition(SwigCPtr), true);
283 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287 public void SetViewportSize(Vector2 size)
289 Interop.RenderTask.SetViewportSize(SwigCPtr, Vector2.getCPtr(size));
290 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
293 public Vector2 GetCurrentViewportSize()
295 Vector2 ret = new Vector2(Interop.RenderTask.GetCurrentViewportSize(SwigCPtr), true);
296 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
300 public void SetViewport(Rectangle viewport)
302 Interop.RenderTask.SetViewport(SwigCPtr, Rectangle.getCPtr(viewport));
303 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
306 public Rectangle GetViewport()
308 Rectangle ret = new Rectangle(Interop.RenderTask.GetViewport(SwigCPtr), true);
309 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
313 [Obsolete("This has been deprecated in API9 and will be removed in API11. Use ClearColor property instead.")]
314 public void SetClearColor(Vector4 color)
316 Interop.RenderTask.SetClearColor(SwigCPtr, Vector4.getCPtr(color));
317 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
320 [Obsolete("This has been deprecated in API9 and will be removed in API11. Use ClearColor property instead.")]
321 public Vector4 GetClearColor()
323 Vector4 ret = new Vector4(Interop.RenderTask.GetClearColor(SwigCPtr), true);
324 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
328 public void SetClearEnabled(bool enabled)
330 Interop.RenderTask.SetClearEnabled(SwigCPtr, enabled);
331 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
334 public bool GetClearEnabled()
336 bool ret = Interop.RenderTask.GetClearEnabled(SwigCPtr);
337 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
341 public void SetCullMode(bool cullMode)
343 Interop.RenderTask.SetCullMode(SwigCPtr, cullMode);
344 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
347 public bool GetCullMode()
349 bool ret = Interop.RenderTask.GetCullMode(SwigCPtr);
350 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
354 public void SetRefreshRate(uint refreshRate)
356 Interop.RenderTask.SetRefreshRate(SwigCPtr, refreshRate);
357 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
360 public uint GetRefreshRate()
362 uint ret = Interop.RenderTask.GetRefreshRate(SwigCPtr);
363 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
367 public bool WorldToViewport(Vector3 position, out float viewportX, out float viewportY)
369 bool ret = Interop.RenderTask.WorldToViewport(SwigCPtr, Vector3.getCPtr(position), out viewportX, out viewportY);
370 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
374 public bool ViewportToLocal(View view, float viewportX, float viewportY, out float localX, out float localY)
376 bool ret = Interop.RenderTask.ViewportToLocal(SwigCPtr, View.getCPtr(view), viewportX, viewportY, out localX, out localY);
377 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
381 internal RenderTaskSignal FinishedSignal()
383 RenderTaskSignal ret = new RenderTaskSignal(Interop.RenderTask.FinishedSignal(SwigCPtr), false);
384 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
388 /// <since_tizen> 3 </since_tizen>
389 public enum RefreshRate
395 public Vector2 ViewportPosition
399 Vector2 retVal = new Vector2(0.0f, 0.0f);
400 PropertyValue viewportPos = GetProperty(RenderTask.Property.ViewportPosition);
401 viewportPos?.Get(retVal);
402 viewportPos?.Dispose();
407 PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
408 SetProperty(RenderTask.Property.ViewportPosition, setVal);
412 public Vector2 ViewportSize
416 Vector2 retVal = new Vector2(0.0f, 0.0f);
417 PropertyValue viewportSize = GetProperty(RenderTask.Property.ViewportSize);
418 viewportSize?.Get(retVal);
419 viewportSize?.Dispose();
424 PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
425 SetProperty(RenderTask.Property.ViewportSize, setVal);
429 public Vector4 ClearColor
433 Vector4 retVal = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
434 PropertyValue clearColor = GetProperty(RenderTask.Property.ClearColor);
435 clearColor?.Get(retVal);
436 clearColor?.Dispose();
441 PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
442 SetProperty(RenderTask.Property.ClearColor, setVal);
446 public bool RequiresSync
451 PropertyValue reqSync = GetProperty(RenderTask.Property.RequiresSync);
452 reqSync?.Get(out retVal);
458 PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
459 SetProperty(RenderTask.Property.RequiresSync, setVal);