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 /// <since_tizen> 3 </since_tizen>
24 public class Renderer : Animatable
26 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
28 internal Renderer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Renderer_SWIGUpcast(cPtr), cMemoryOwn)
30 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
33 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Renderer obj)
35 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
41 /// <since_tizen> 3 </since_tizen>
42 protected override void Dispose(DisposeTypes type)
49 if (type == DisposeTypes.Explicit)
52 //Release your own managed resources here.
53 //You should release all of your own disposable objects here.
57 //Release your own unmanaged resources here.
58 //You should not access any managed member here except static instance.
59 //because the execution order of Finalizes is non-deterministic.
62 if (swigCPtr.Handle != global::System.IntPtr.Zero)
67 NDalicPINVOKE.delete_Renderer(swigCPtr);
69 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
76 /// Enumeration for instances of properties belonging to the Renderer class.
78 /// <since_tizen> 3 </since_tizen>
82 /// This should be internal, please do not use.
84 /// <since_tizen> 3 </since_tizen>
85 public static readonly int DEPTH_INDEX = NDalicPINVOKE.Renderer_Property_DEPTH_INDEX_get();
87 /// This should be internal, please do not use.
89 /// <since_tizen> 3 </since_tizen>
90 public static readonly int FACE_CULLING_MODE = NDalicPINVOKE.Renderer_Property_FACE_CULLING_MODE_get();
92 /// This should be internal, please do not use.
94 /// <since_tizen> 3 </since_tizen>
95 public static readonly int BLEND_MODE = NDalicPINVOKE.Renderer_Property_BLEND_MODE_get();
97 /// This should be internal, please do not use.
99 /// <since_tizen> 3 </since_tizen>
100 public static readonly int BLEND_EQUATION_RGB = NDalicPINVOKE.Renderer_Property_BLEND_EQUATION_RGB_get();
102 /// This should be internal, please do not use.
104 /// <since_tizen> 3 </since_tizen>
105 public static readonly int BLEND_EQUATION_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_EQUATION_ALPHA_get();
107 /// This should be internal, please do not use.
109 /// <since_tizen> 3 </since_tizen>
110 public static readonly int BLEND_FACTOR_SRC_RGB = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_SRC_RGB_get();
112 /// This should be internal, please do not use.
114 /// <since_tizen> 3 </since_tizen>
115 public static readonly int BLEND_FACTOR_DEST_RGB = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_DEST_RGB_get();
117 /// This should be internal, please do not use.
119 /// <since_tizen> 3 </since_tizen>
120 public static readonly int BLEND_FACTOR_SRC_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_SRC_ALPHA_get();
122 /// This should be internal, please do not use.
124 /// <since_tizen> 3 </since_tizen>
125 public static readonly int BLEND_FACTOR_DEST_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_DEST_ALPHA_get();
127 /// This should be internal, please do not use.
129 /// <since_tizen> 3 </since_tizen>
130 public static readonly int BLEND_COLOR = NDalicPINVOKE.Renderer_Property_BLEND_COLOR_get();
132 /// This should be internal, please do not use.
134 /// <since_tizen> 3 </since_tizen>
135 public static readonly int BLEND_PRE_MULTIPLIED_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_PRE_MULTIPLIED_ALPHA_get();
137 /// This should be internal, please do not use.
139 /// <since_tizen> 3 </since_tizen>
140 public static readonly int INDEX_RANGE_FIRST = NDalicPINVOKE.Renderer_Property_INDEX_RANGE_FIRST_get();
142 /// This should be internal, please do not use.
144 /// <since_tizen> 3 </since_tizen>
145 public static readonly int INDEX_RANGE_COUNT = NDalicPINVOKE.Renderer_Property_INDEX_RANGE_COUNT_get();
147 /// This should be internal, please do not use.
149 /// <since_tizen> 3 </since_tizen>
150 public static readonly int DEPTH_WRITE_MODE = NDalicPINVOKE.Renderer_Property_DEPTH_WRITE_MODE_get();
152 /// This should be internal, please do not use.
154 /// <since_tizen> 3 </since_tizen>
155 public static readonly int DEPTH_FUNCTION = NDalicPINVOKE.Renderer_Property_DEPTH_FUNCTION_get();
157 /// This should be internal, please do not use.
159 /// <since_tizen> 3 </since_tizen>
160 public static readonly int DEPTH_TEST_MODE = NDalicPINVOKE.Renderer_Property_DEPTH_TEST_MODE_get();
162 /// This should be internal, please do not use.
164 /// <since_tizen> 3 </since_tizen>
165 public static readonly int RENDER_MODE = NDalicPINVOKE.Renderer_Property_RENDER_MODE_get();
167 /// This should be internal, please do not use.
169 /// <since_tizen> 3 </since_tizen>
170 public static readonly int STENCIL_FUNCTION = NDalicPINVOKE.Renderer_Property_STENCIL_FUNCTION_get();
172 /// This should be internal, please do not use.
174 /// <since_tizen> 3 </since_tizen>
175 public static readonly int STENCIL_FUNCTION_MASK = NDalicPINVOKE.Renderer_Property_STENCIL_FUNCTION_MASK_get();
177 /// This should be internal, please do not use.
179 /// <since_tizen> 3 </since_tizen>
180 public static readonly int STENCIL_FUNCTION_REFERENCE = NDalicPINVOKE.Renderer_Property_STENCIL_FUNCTION_REFERENCE_get();
182 /// This should be internal, please do not use.
184 /// <since_tizen> 3 </since_tizen>
185 public static readonly int STENCIL_MASK = NDalicPINVOKE.Renderer_Property_STENCIL_MASK_get();
187 /// This should be internal, please do not use.
189 /// <since_tizen> 3 </since_tizen>
190 public static readonly int STENCIL_OPERATION_ON_FAIL = NDalicPINVOKE.Renderer_Property_STENCIL_OPERATION_ON_FAIL_get();
192 /// This should be internal, please do not use.
194 /// <since_tizen> 3 </since_tizen>
195 public static readonly int STENCIL_OPERATION_ON_Z_FAIL = NDalicPINVOKE.Renderer_Property_STENCIL_OPERATION_ON_Z_FAIL_get();
197 /// This should be internal, please do not use.
199 /// <since_tizen> 3 </since_tizen>
200 public static readonly int STENCIL_OPERATION_ON_Z_PASS = NDalicPINVOKE.Renderer_Property_STENCIL_OPERATION_ON_Z_PASS_get();
205 /// Create an instance of Renderer.
207 /// <since_tizen> 3 </since_tizen>
208 public Renderer(Geometry geometry, Shader shader) : this(NDalicPINVOKE.Renderer_New(Geometry.getCPtr(geometry), Shader.getCPtr(shader)), true)
210 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215 /// Sets the geometry to be used by this renderer.
217 /// <param name="geometry">The geometry to be used by this renderer.</param>
218 /// <since_tizen> 3 </since_tizen>
219 public void SetGeometry(Geometry geometry)
221 NDalicPINVOKE.Renderer_SetGeometry(swigCPtr, Geometry.getCPtr(geometry));
222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 /// Gets the geometry used by this renderer.
228 /// <returns>The geometry used by the renderer.</returns>
229 /// <since_tizen> 3 </since_tizen>
230 public Geometry GetGeometry()
232 System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetGeometry(swigCPtr);
233 Geometry ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Geometry;
235 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240 /// Sets effective range of indices to draw from bound index buffer.
242 /// <param name="firstElement">The First element to draw.</param>
243 /// <param name="elementsCount">The number of elements to draw.</param>
244 /// <since_tizen> 3 </since_tizen>
245 public void SetIndexRange(int firstElement, int elementsCount)
247 NDalicPINVOKE.Renderer_SetIndexRange(swigCPtr, firstElement, elementsCount);
248 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
252 /// Sets the texture set to be used by this renderer.
254 /// <param name="textureSet">The texture set to be used by this renderer.</param>
255 /// <since_tizen> 3 </since_tizen>
256 public void SetTextures(TextureSet textureSet)
258 NDalicPINVOKE.Renderer_SetTextures(swigCPtr, TextureSet.getCPtr(textureSet));
259 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
263 /// Gets the texture set used by this renderer.
265 /// <returns>The texture set used by the renderer.</returns>
266 /// <since_tizen> 3 </since_tizen>
267 public TextureSet GetTextures()
269 System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetTextures(swigCPtr);
270 TextureSet ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as TextureSet;
272 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
277 /// Sets the shader used by this renderer.
279 /// <param name="shader">The shader to be used by this renderer.</param>
280 /// <since_tizen> 3 </since_tizen>
281 public void SetShader(Shader shader)
283 NDalicPINVOKE.Renderer_SetShader(swigCPtr, Shader.getCPtr(shader));
284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
288 /// Gets the shader used by this renderer.
290 /// <returns>The shader used by the renderer.</returns>
291 /// <since_tizen> 3 </since_tizen>
292 public Shader GetShader()
294 System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetShader(swigCPtr);
295 Shader ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Shader;
297 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
302 /// Gets and Sets DepthIndex property.
304 /// <since_tizen> 3 </since_tizen>
305 public int DepthIndex
310 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.DEPTH_INDEX).Get(out temp);
315 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.DEPTH_INDEX, new Tizen.NUI.PropertyValue(value));
320 /// Gets and Sets FaceCullingMode.
322 /// <since_tizen> 3 </since_tizen>
323 public int FaceCullingMode
328 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.FACE_CULLING_MODE).Get(out temp);
333 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.FACE_CULLING_MODE, new Tizen.NUI.PropertyValue(value));
338 /// Gets and Sets BlendMode.
340 /// <since_tizen> 3 </since_tizen>
346 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_MODE).Get(out temp);
351 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_MODE, new Tizen.NUI.PropertyValue(value));
356 /// Gets and Sets BlendEquationRgb.
358 /// <since_tizen> 3 </since_tizen>
359 public int BlendEquationRgb
364 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_EQUATION_RGB).Get(out temp);
369 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_EQUATION_RGB, new Tizen.NUI.PropertyValue(value));
374 /// Gets and Sets BlendEquationAlpha.
376 /// <since_tizen> 3 </since_tizen>
377 public int BlendEquationAlpha
382 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_EQUATION_ALPHA).Get(out temp);
387 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_EQUATION_ALPHA, new Tizen.NUI.PropertyValue(value));
392 /// Gets and Sets BlendFactorSrcRgb.
394 /// <since_tizen> 3 </since_tizen>
395 public int BlendFactorSrcRgb
400 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_SRC_RGB).Get(out temp);
405 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_SRC_RGB, new Tizen.NUI.PropertyValue(value));
410 /// Gets and Sets BlendFactorDestRgb.
412 /// <since_tizen> 3 </since_tizen>
413 public int BlendFactorDestRgb
418 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_DEST_RGB).Get(out temp);
423 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_DEST_RGB, new Tizen.NUI.PropertyValue(value));
428 /// Gets and Sets BlendFactorSrcAlpha.
430 /// <since_tizen> 3 </since_tizen>
431 public int BlendFactorSrcAlpha
436 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_SRC_ALPHA).Get(out temp);
441 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_SRC_ALPHA, new Tizen.NUI.PropertyValue(value));
446 /// Gets and Sets BlendFactorDestAlpha.
448 /// <since_tizen> 3 </since_tizen>
449 public int BlendFactorDestAlpha
454 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_DEST_ALPHA).Get(out temp);
459 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_DEST_ALPHA, new Tizen.NUI.PropertyValue(value));
464 /// Gets and Sets BlendColor.
466 /// <since_tizen> 3 </since_tizen>
467 public Vector4 BlendColor
471 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
472 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_COLOR).Get(temp);
477 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_COLOR, new Tizen.NUI.PropertyValue(value));
482 /// Gets and Sets BlendPreMultipliedAlpha.
484 /// <since_tizen> 3 </since_tizen>
485 public bool BlendPreMultipliedAlpha
490 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_PRE_MULTIPLIED_ALPHA).Get(out temp);
495 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_PRE_MULTIPLIED_ALPHA, new Tizen.NUI.PropertyValue(value));
500 /// Gets and Sets IndexRangeFirst.
502 /// <since_tizen> 3 </since_tizen>
503 public int IndexRangeFirst
508 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.INDEX_RANGE_FIRST).Get(out temp);
513 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.INDEX_RANGE_FIRST, new Tizen.NUI.PropertyValue(value));
518 /// Gets and Sets IndexRangeCount.
520 /// <since_tizen> 3 </since_tizen>
521 public int IndexRangeCount
526 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.INDEX_RANGE_COUNT).Get(out temp);
531 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.INDEX_RANGE_COUNT, new Tizen.NUI.PropertyValue(value));
536 /// Gets and Sets DepthWriteMode.
538 /// <since_tizen> 3 </since_tizen>
539 public int DepthWriteMode
544 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.DEPTH_WRITE_MODE).Get(out temp);
549 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.DEPTH_WRITE_MODE, new Tizen.NUI.PropertyValue(value));
554 /// Gets and Sets DepthFunction.
556 /// <since_tizen> 3 </since_tizen>
557 public int DepthFunction
562 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.DEPTH_FUNCTION).Get(out temp);
567 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.DEPTH_FUNCTION, new Tizen.NUI.PropertyValue(value));
572 /// Gets and Sets DepthTestMode.
574 /// <since_tizen> 3 </since_tizen>
575 public int DepthTestMode
580 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.DEPTH_TEST_MODE).Get(out temp);
585 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.DEPTH_TEST_MODE, new Tizen.NUI.PropertyValue(value));
590 /// Gets and Sets RenderMode.
592 /// <since_tizen> 3 </since_tizen>
593 public int RenderMode
598 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.RENDER_MODE).Get(out temp);
603 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.RENDER_MODE, new Tizen.NUI.PropertyValue(value));
608 /// Gets and Sets StencilFunction.
610 /// <since_tizen> 3 </since_tizen>
611 public int StencilFunction
616 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.STENCIL_FUNCTION).Get(out temp);
621 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.STENCIL_FUNCTION, new Tizen.NUI.PropertyValue(value));
626 /// Gets and Sets StencilFunctionMask.
628 /// <since_tizen> 3 </since_tizen>
629 public int StencilFunctionMask
634 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.STENCIL_FUNCTION_MASK).Get(out temp);
639 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.STENCIL_FUNCTION_MASK, new Tizen.NUI.PropertyValue(value));
644 /// Gets and Sets StencilFunctionReference.
646 /// <since_tizen> 3 </since_tizen>
647 public int StencilFunctionReference
652 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.STENCIL_FUNCTION_REFERENCE).Get(out temp);
657 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.STENCIL_FUNCTION_REFERENCE, new Tizen.NUI.PropertyValue(value));
662 /// Gets and Sets StencilMask.
664 /// <since_tizen> 3 </since_tizen>
665 public int StencilMask
670 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.STENCIL_MASK).Get(out temp);
675 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.STENCIL_MASK, new Tizen.NUI.PropertyValue(value));
680 /// Gets and Sets StencilOperationOnFail.
682 /// <since_tizen> 3 </since_tizen>
683 public int StencilOperationOnFail
688 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.STENCIL_OPERATION_ON_FAIL).Get(out temp);
693 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.STENCIL_OPERATION_ON_FAIL, new Tizen.NUI.PropertyValue(value));
698 /// Gets and Sets StencilOperationOnZFail.
700 /// <since_tizen> 3 </since_tizen>
701 public int StencilOperationOnZFail
706 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.STENCIL_OPERATION_ON_Z_FAIL).Get(out temp);
711 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.STENCIL_OPERATION_ON_Z_FAIL, new Tizen.NUI.PropertyValue(value));
716 /// Gets and Sets StencilOperationOnZPass property.
718 /// <since_tizen> 3 </since_tizen>
719 public int StencilOperationOnZPass
724 Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.STENCIL_OPERATION_ON_Z_PASS).Get(out temp);
729 Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.STENCIL_OPERATION_ON_Z_PASS, new Tizen.NUI.PropertyValue(value));