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.
18 using System.Diagnostics.CodeAnalysis;
19 using System.ComponentModel;
26 /// <since_tizen> 3 </since_tizen>
27 public class Shader : Animatable
31 /// Creates Shader object.
33 /// <param name="vertexShader">The vertex shader code for the effect.</param>
34 /// <param name="fragmentShader">The fragment Shader code for the effect.</param>
35 /// <param name="hints">The hints to define the geometry of the rendered object.</param>
36 /// <since_tizen> 3 </since_tizen>
37 public Shader(string vertexShader, string fragmentShader, Shader.Hint.Value hints) : this(Interop.Shader.New(vertexShader, fragmentShader, (int)hints), true)
39 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
43 /// Creates Shader object.
45 /// <param name="vertexShader">The vertex shader code for the effect.</param>
46 /// <param name="fragmentShader">The fragment Shader code for the effect.</param>
47 /// <since_tizen> 3 </since_tizen>
48 public Shader(string vertexShader, string fragmentShader) : this(Interop.Shader.New(vertexShader, fragmentShader), true)
50 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
54 /// Gets and Sets the program property.
56 /// <since_tizen> 3 </since_tizen>
57 public Tizen.NUI.PropertyMap Program
61 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
62 var pValue = Tizen.NUI.Object.GetProperty(SwigCPtr, Shader.Property.PROGRAM);
69 var temp = new Tizen.NUI.PropertyValue(value);
70 Tizen.NUI.Object.SetProperty(SwigCPtr, Shader.Property.PROGRAM, temp);
75 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Shader obj)
77 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
80 internal Shader(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Shader.Upcast(cPtr), cMemoryOwn)
84 /// This will not be public opened.
85 [EditorBrowsable(EditorBrowsableState.Never)]
86 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
88 Interop.Shader.DeleteShader(swigCPtr);
94 /// <since_tizen> 3 </since_tizen>
95 public sealed class Hint
98 /// Enumeration for the hint value.
100 /// <since_tizen> 3 </since_tizen>
106 /// <since_tizen> 3 </since_tizen>
110 /// Might generate transparent alpha from opaque inputs
112 /// <since_tizen> 3 </since_tizen>
113 OUTPUT_IS_TRANSPARENT = 0x01,
116 /// Might change position of vertices, this option disables any culling optimizations
118 /// <since_tizen> 3 </since_tizen>
119 MODIFIES_GEOMETRY = 0x02
124 /// Enumeration for instances of properties belonging to the Shader class.
126 /// <since_tizen> 3 </since_tizen>
127 [EditorBrowsable(EditorBrowsableState.Never)]
128 [Obsolete("Deprecated in API6; Will be removed in API9.")]
129 #pragma warning disable CA1716, CA1052, CA1034 // Identifiers should not match keywords
130 public class Property
131 #pragma warning restore CA1716, CA1052, CA1034 // Identifiers should not match keywords
134 /// The default value is empty.
135 /// Format: {"vertex":"","fragment":"",hints:"","vertexPrefix":"","fragmentPrefix":""}
137 /// <since_tizen> 3 </since_tizen>
138 [EditorBrowsable(EditorBrowsableState.Never)]
139 [Obsolete("Deprecated in API6; Will be removed in API9.")]
140 public static readonly int PROGRAM = Interop.Shader.ProgramGet();