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.
23 /// <since_tizen> 3 </since_tizen>
24 public class Shader : Animatable
26 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
28 internal Shader(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Shader_SWIGUpcast(cPtr), cMemoryOwn)
30 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
33 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Shader 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.
61 if (swigCPtr.Handle != global::System.IntPtr.Zero)
66 NDalicPINVOKE.delete_Shader(swigCPtr);
68 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
77 /// <since_tizen> 3 </since_tizen>
81 /// Enumeration for the hint value.
83 /// <since_tizen> 3 </since_tizen>
89 /// <since_tizen> 3 </since_tizen>
93 /// Might generate transparent alpha from opaque inputs
95 /// <since_tizen> 3 </since_tizen>
96 OUTPUT_IS_TRANSPARENT = 0x01,
99 /// Might change position of vertices, this option disables any culling optimizations
101 /// <since_tizen> 3 </since_tizen>
102 MODIFIES_GEOMETRY = 0x02
107 /// Enumeration for instances of properties belonging to the Shader class.
109 /// <since_tizen> 3 </since_tizen>
110 public class Property
113 /// The default value is empty.
114 /// Format: {"vertex":"","fragment":"",hints:"","vertexPrefix":"","fragmentPrefix":""}
116 /// <since_tizen> 3 </since_tizen>
117 public static readonly int PROGRAM = NDalicPINVOKE.Shader_Property_PROGRAM_get();
121 /// Creates Shader object.
123 /// <param name="vertexShader">The vertex shader code for the effect.</param>
124 /// <param name="fragmentShader">The fragment Shader code for the effect.</param>
125 /// <param name="hints">The hints to define the geometry of the rendered object.</param>
126 /// <since_tizen> 3 </since_tizen>
127 public Shader(string vertexShader, string fragmentShader, Shader.Hint.Value hints) : this(NDalicPINVOKE.Shader_New__SWIG_0(vertexShader, fragmentShader, (int)hints), true)
129 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134 /// Creates Shader object.
136 /// <param name="vertexShader">The vertex shader code for the effect.</param>
137 /// <param name="fragmentShader">The fragment Shader code for the effect.</param>
138 /// <since_tizen> 3 </since_tizen>
139 public Shader(string vertexShader, string fragmentShader) : this(NDalicPINVOKE.Shader_New__SWIG_1(vertexShader, fragmentShader), true)
141 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147 /// Gets and Sets the program property.
149 /// <since_tizen> 3 </since_tizen>
150 public Tizen.NUI.PropertyMap Program
154 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
155 Tizen.NUI.Object.GetProperty(swigCPtr, Shader.Property.PROGRAM).Get(temp);
160 Tizen.NUI.Object.SetProperty(swigCPtr, Shader.Property.PROGRAM, new Tizen.NUI.PropertyValue(value));