2 * Copyright(c) 2017 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.
21 /// Renderer is a handle to an object used to show content by combining a Geometry, a TextureSet and a shader.
23 public class Renderer : Animatable
25 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27 internal Renderer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Renderer_SWIGUpcast(cPtr), cMemoryOwn)
29 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
32 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Renderer obj)
34 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
40 /// <since_tizen> 3 </since_tizen>
41 protected override void Dispose(DisposeTypes type)
48 if (type == DisposeTypes.Explicit)
51 //Release your own managed resources here.
52 //You should release all of your own disposable objects here.
56 //Release your own unmanaged resources here.
57 //You should not access any managed member here except static instance.
58 //because the execution order of Finalizes is non-deterministic.
61 if (swigCPtr.Handle != global::System.IntPtr.Zero)
66 NDalicPINVOKE.delete_Renderer(swigCPtr);
68 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
75 /// Enumeration for instances of properties belonging to the Renderer class.
77 /// <since_tizen> 3 </since_tizen>
81 /// This should be internal, please do not use.
83 /// <since_tizen> 3 </since_tizen>
84 public static readonly int DEPTH_INDEX = NDalicPINVOKE.Renderer_Property_DEPTH_INDEX_get();
86 /// This should be internal, please do not use.
88 /// <since_tizen> 3 </since_tizen>
89 public static readonly int FACE_CULLING_MODE = NDalicPINVOKE.Renderer_Property_FACE_CULLING_MODE_get();
91 /// This should be internal, please do not use.
93 /// <since_tizen> 3 </since_tizen>
94 public static readonly int BLEND_MODE = NDalicPINVOKE.Renderer_Property_BLEND_MODE_get();
96 /// This should be internal, please do not use.
98 /// <since_tizen> 3 </since_tizen>
99 public static readonly int BLEND_EQUATION_RGB = NDalicPINVOKE.Renderer_Property_BLEND_EQUATION_RGB_get();
101 /// This should be internal, please do not use.
103 /// <since_tizen> 3 </since_tizen>
104 public static readonly int BLEND_EQUATION_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_EQUATION_ALPHA_get();
106 /// This should be internal, please do not use.
108 /// <since_tizen> 3 </since_tizen>
109 public static readonly int BLEND_FACTOR_SRC_RGB = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_SRC_RGB_get();
111 /// This should be internal, please do not use.
113 /// <since_tizen> 3 </since_tizen>
114 public static readonly int BLEND_FACTOR_DEST_RGB = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_DEST_RGB_get();
116 /// This should be internal, please do not use.
118 /// <since_tizen> 3 </since_tizen>
119 public static readonly int BLEND_FACTOR_SRC_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_SRC_ALPHA_get();
121 /// This should be internal, please do not use.
123 /// <since_tizen> 3 </since_tizen>
124 public static readonly int BLEND_FACTOR_DEST_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_DEST_ALPHA_get();
126 /// This should be internal, please do not use.
128 /// <since_tizen> 3 </since_tizen>
129 public static readonly int BLEND_COLOR = NDalicPINVOKE.Renderer_Property_BLEND_COLOR_get();
131 /// This should be internal, please do not use.
133 /// <since_tizen> 3 </since_tizen>
134 public static readonly int BLEND_PRE_MULTIPLIED_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_PRE_MULTIPLIED_ALPHA_get();
136 /// This should be internal, please do not use.
138 /// <since_tizen> 3 </since_tizen>
139 public static readonly int INDEX_RANGE_FIRST = NDalicPINVOKE.Renderer_Property_INDEX_RANGE_FIRST_get();
141 /// This should be internal, please do not use.
143 /// <since_tizen> 3 </since_tizen>
144 public static readonly int INDEX_RANGE_COUNT = NDalicPINVOKE.Renderer_Property_INDEX_RANGE_COUNT_get();
146 /// This should be internal, please do not use.
148 /// <since_tizen> 3 </since_tizen>
149 public static readonly int DEPTH_WRITE_MODE = NDalicPINVOKE.Renderer_Property_DEPTH_WRITE_MODE_get();
151 /// This should be internal, please do not use.
153 /// <since_tizen> 3 </since_tizen>
154 public static readonly int DEPTH_FUNCTION = NDalicPINVOKE.Renderer_Property_DEPTH_FUNCTION_get();
156 /// This should be internal, please do not use.
158 /// <since_tizen> 3 </since_tizen>
159 public static readonly int DEPTH_TEST_MODE = NDalicPINVOKE.Renderer_Property_DEPTH_TEST_MODE_get();
161 /// This should be internal, please do not use.
163 /// <since_tizen> 3 </since_tizen>
164 public static readonly int RENDER_MODE = NDalicPINVOKE.Renderer_Property_RENDER_MODE_get();
166 /// This should be internal, please do not use.
168 /// <since_tizen> 3 </since_tizen>
169 public static readonly int STENCIL_FUNCTION = NDalicPINVOKE.Renderer_Property_STENCIL_FUNCTION_get();
171 /// This should be internal, please do not use.
173 /// <since_tizen> 3 </since_tizen>
174 public static readonly int STENCIL_FUNCTION_MASK = NDalicPINVOKE.Renderer_Property_STENCIL_FUNCTION_MASK_get();
176 /// This should be internal, please do not use.
178 /// <since_tizen> 3 </since_tizen>
179 public static readonly int STENCIL_FUNCTION_REFERENCE = NDalicPINVOKE.Renderer_Property_STENCIL_FUNCTION_REFERENCE_get();
181 /// This should be internal, please do not use.
183 /// <since_tizen> 3 </since_tizen>
184 public static readonly int STENCIL_MASK = NDalicPINVOKE.Renderer_Property_STENCIL_MASK_get();
186 /// This should be internal, please do not use.
188 /// <since_tizen> 3 </since_tizen>
189 public static readonly int STENCIL_OPERATION_ON_FAIL = NDalicPINVOKE.Renderer_Property_STENCIL_OPERATION_ON_FAIL_get();
191 /// This should be internal, please do not use.
193 /// <since_tizen> 3 </since_tizen>
194 public static readonly int STENCIL_OPERATION_ON_Z_FAIL = NDalicPINVOKE.Renderer_Property_STENCIL_OPERATION_ON_Z_FAIL_get();
196 /// This should be internal, please do not use.
198 /// <since_tizen> 3 </since_tizen>
199 public static readonly int STENCIL_OPERATION_ON_Z_PASS = NDalicPINVOKE.Renderer_Property_STENCIL_OPERATION_ON_Z_PASS_get();
204 /// Create an instance of Renderer.
206 /// <since_tizen> 3 </since_tizen>
207 public Renderer(Geometry geometry, Shader shader) : this(NDalicPINVOKE.Renderer_New(Geometry.getCPtr(geometry), Shader.getCPtr(shader)), true)
209 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214 /// Sets the geometry to be used by this renderer.
216 /// <param name="geometry">The geometry to be used by this renderer.</param>
217 /// <since_tizen> 3 </since_tizen>
218 public void SetGeometry(Geometry geometry)
220 NDalicPINVOKE.Renderer_SetGeometry(swigCPtr, Geometry.getCPtr(geometry));
221 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225 /// Gets the geometry used by this renderer.
227 /// <returns>The geometry used by the renderer.</returns>
228 /// <since_tizen> 3 </since_tizen>
229 public Geometry GetGeometry()
231 System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetGeometry(swigCPtr);
232 Geometry ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Geometry;
234 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239 /// Sets effective range of indices to draw from bound index buffer.
241 /// <param name="firstElement">The First element to draw.</param>
242 /// <param name="elementsCount">The number of elements to draw.</param>
243 /// <since_tizen> 3 </since_tizen>
244 public void SetIndexRange(int firstElement, int elementsCount)
246 NDalicPINVOKE.Renderer_SetIndexRange(swigCPtr, firstElement, elementsCount);
247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
251 /// Sets the texture set to be used by this renderer.
253 /// <param name="textureSet">The texture set to be used by this renderer.</param>
254 /// <since_tizen> 3 </since_tizen>
255 public void SetTextures(TextureSet textureSet)
257 NDalicPINVOKE.Renderer_SetTextures(swigCPtr, TextureSet.getCPtr(textureSet));
258 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
262 /// Gets the texture set used by this renderer.
264 /// <returns>The texture set used by the renderer.</returns>
265 /// <since_tizen> 3 </since_tizen>
266 public TextureSet GetTextures()
268 System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetTextures(swigCPtr);
269 TextureSet ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as TextureSet;
271 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
276 /// Sets the shader used by this renderer.
278 /// <param name="shader">The shader to be used by this renderer.</param>
279 /// <since_tizen> 3 </since_tizen>
280 public void SetShader(Shader shader)
282 NDalicPINVOKE.Renderer_SetShader(swigCPtr, Shader.getCPtr(shader));
283 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287 /// Gets the shader used by this renderer.
289 /// <returns>The shader used by the renderer.</returns>
290 /// <since_tizen> 3 </since_tizen>
291 public Shader GetShader()
293 System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetShader(swigCPtr);
294 Shader ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Shader;
296 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301 /// Gets and Sets DepthIndex property.
303 /// <since_tizen> 3 </since_tizen>
304 public int DepthIndex
309 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.DEPTH_INDEX).Get(out temp);
314 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.DEPTH_INDEX, new Tizen.NUI.PropertyValue(value));
319 /// Gets and Sets FaceCullingMode.
321 /// <since_tizen> 3 </since_tizen>
322 public int FaceCullingMode
327 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.FACE_CULLING_MODE).Get(out temp);
332 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.FACE_CULLING_MODE, new Tizen.NUI.PropertyValue(value));
337 /// Gets and Sets BlendMode.
339 /// <since_tizen> 3 </since_tizen>
345 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_MODE).Get(out temp);
350 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_MODE, new Tizen.NUI.PropertyValue(value));
355 /// Gets and Sets BlendEquationRgb.
357 /// <since_tizen> 3 </since_tizen>
358 public int BlendEquationRgb
363 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_EQUATION_RGB).Get(out temp);
368 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_EQUATION_RGB, new Tizen.NUI.PropertyValue(value));
373 /// Gets and Sets BlendEquationAlpha.
375 /// <since_tizen> 3 </since_tizen>
376 public int BlendEquationAlpha
381 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_EQUATION_ALPHA).Get(out temp);
386 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_EQUATION_ALPHA, new Tizen.NUI.PropertyValue(value));
391 /// Gets and Sets BlendFactorSrcRgb.
393 /// <since_tizen> 3 </since_tizen>
394 public int BlendFactorSrcRgb
399 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_SRC_RGB).Get(out temp);
404 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_SRC_RGB, new Tizen.NUI.PropertyValue(value));
409 /// Gets and Sets BlendFactorDestRgb.
411 /// <since_tizen> 3 </since_tizen>
412 public int BlendFactorDestRgb
417 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_DEST_RGB).Get(out temp);
422 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_DEST_RGB, new Tizen.NUI.PropertyValue(value));
427 /// Gets and Sets BlendFactorSrcAlpha.
429 /// <since_tizen> 3 </since_tizen>
430 public int BlendFactorSrcAlpha
435 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_SRC_ALPHA).Get(out temp);
440 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_SRC_ALPHA, new Tizen.NUI.PropertyValue(value));
445 /// Gets and Sets BlendFactorDestAlpha.
447 /// <since_tizen> 3 </since_tizen>
448 public int BlendFactorDestAlpha
453 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_DEST_ALPHA).Get(out temp);
458 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_DEST_ALPHA, new Tizen.NUI.PropertyValue(value));
463 /// Gets and Sets BlendColor.
465 /// <since_tizen> 3 </since_tizen>
466 public Vector4 BlendColor
470 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
471 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_COLOR).Get(temp);
476 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_COLOR, new Tizen.NUI.PropertyValue(value));
481 /// Gets and Sets BlendPreMultipliedAlpha.
483 /// <since_tizen> 3 </since_tizen>
484 public bool BlendPreMultipliedAlpha
489 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_PRE_MULTIPLIED_ALPHA).Get(out temp);
494 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_PRE_MULTIPLIED_ALPHA, new Tizen.NUI.PropertyValue(value));
499 /// Gets and Sets IndexRangeFirst.
501 /// <since_tizen> 3 </since_tizen>
502 public int IndexRangeFirst
507 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.INDEX_RANGE_FIRST).Get(out temp);
512 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.INDEX_RANGE_FIRST, new Tizen.NUI.PropertyValue(value));
517 /// Gets and Sets IndexRangeCount.
519 /// <since_tizen> 3 </since_tizen>
520 public int IndexRangeCount
525 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.INDEX_RANGE_COUNT).Get(out temp);
530 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.INDEX_RANGE_COUNT, new Tizen.NUI.PropertyValue(value));
535 /// Gets and Sets DepthWriteMode.
537 /// <since_tizen> 3 </since_tizen>
538 public int DepthWriteMode
543 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.DEPTH_WRITE_MODE).Get(out temp);
548 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.DEPTH_WRITE_MODE, new Tizen.NUI.PropertyValue(value));
553 /// Gets and Sets DepthFunction.
555 /// <since_tizen> 3 </since_tizen>
556 public int DepthFunction
561 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.DEPTH_FUNCTION).Get(out temp);
566 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.DEPTH_FUNCTION, new Tizen.NUI.PropertyValue(value));
571 /// Gets and Sets DepthTestMode.
573 /// <since_tizen> 3 </since_tizen>
574 public int DepthTestMode
579 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.DEPTH_TEST_MODE).Get(out temp);
584 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.DEPTH_TEST_MODE, new Tizen.NUI.PropertyValue(value));
589 /// Gets and Sets RenderMode.
591 /// <since_tizen> 3 </since_tizen>
592 public int RenderMode
597 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.RENDER_MODE).Get(out temp);
602 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.RENDER_MODE, new Tizen.NUI.PropertyValue(value));
607 /// Gets and Sets StencilFunction.
609 /// <since_tizen> 3 </since_tizen>
610 public int StencilFunction
615 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.STENCIL_FUNCTION).Get(out temp);
620 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.STENCIL_FUNCTION, new Tizen.NUI.PropertyValue(value));
625 /// Gets and Sets StencilFunctionMask.
627 /// <since_tizen> 3 </since_tizen>
628 public int StencilFunctionMask
633 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.STENCIL_FUNCTION_MASK).Get(out temp);
638 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.STENCIL_FUNCTION_MASK, new Tizen.NUI.PropertyValue(value));
643 /// Gets and Sets StencilFunctionReference.
645 /// <since_tizen> 3 </since_tizen>
646 public int StencilFunctionReference
651 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.STENCIL_FUNCTION_REFERENCE).Get(out temp);
656 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.STENCIL_FUNCTION_REFERENCE, new Tizen.NUI.PropertyValue(value));
661 /// Gets and Sets StencilMask.
663 /// <since_tizen> 3 </since_tizen>
664 public int StencilMask
669 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.STENCIL_MASK).Get(out temp);
674 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.STENCIL_MASK, new Tizen.NUI.PropertyValue(value));
679 /// Gets and Sets StencilOperationOnFail.
681 /// <since_tizen> 3 </since_tizen>
682 public int StencilOperationOnFail
687 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.STENCIL_OPERATION_ON_FAIL).Get(out temp);
692 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.STENCIL_OPERATION_ON_FAIL, new Tizen.NUI.PropertyValue(value));
697 /// Gets and Sets StencilOperationOnZFail.
699 /// <since_tizen> 3 </since_tizen>
700 public int StencilOperationOnZFail
705 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.STENCIL_OPERATION_ON_Z_FAIL).Get(out temp);
710 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.STENCIL_OPERATION_ON_Z_FAIL, new Tizen.NUI.PropertyValue(value));
715 /// Gets and Sets StencilOperationOnZPass property.
717 /// <since_tizen> 3 </since_tizen>
718 public int StencilOperationOnZPass
723 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.STENCIL_OPERATION_ON_Z_PASS).Get(out temp);
728 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.STENCIL_OPERATION_ON_Z_PASS, new Tizen.NUI.PropertyValue(value));