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 Tizen.NUI.Object.GetProperty(swigCPtr, Shader.Property.PROGRAM).Get(temp);
67 Tizen.NUI.Object.SetProperty(swigCPtr, Shader.Property.PROGRAM, new Tizen.NUI.PropertyValue(value));
71 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Shader obj)
73 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
76 internal Shader(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Shader.Upcast(cPtr), cMemoryOwn)
80 /// This will not be public opened.
81 [EditorBrowsable(EditorBrowsableState.Never)]
82 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
84 Interop.Shader.DeleteShader(swigCPtr);
90 /// <since_tizen> 3 </since_tizen>
91 public sealed class Hint
94 /// Enumeration for the hint value.
96 /// <since_tizen> 3 </since_tizen>
102 /// <since_tizen> 3 </since_tizen>
106 /// Might generate transparent alpha from opaque inputs
108 /// <since_tizen> 3 </since_tizen>
109 OUTPUT_IS_TRANSPARENT = 0x01,
112 /// Might change position of vertices, this option disables any culling optimizations
114 /// <since_tizen> 3 </since_tizen>
115 MODIFIES_GEOMETRY = 0x02
120 /// Enumeration for instances of properties belonging to the Shader class.
122 /// <since_tizen> 3 </since_tizen>
123 [EditorBrowsable(EditorBrowsableState.Never)]
124 [Obsolete("Deprecated in API6; Will be removed in API9.")]
125 #pragma warning disable CA1716, CA1052, CA1034 // Identifiers should not match keywords
126 public class Property
127 #pragma warning restore CA1716, CA1052, CA1034 // Identifiers should not match keywords
130 /// The default value is empty.
131 /// Format: {"vertex":"","fragment":"",hints:"","vertexPrefix":"","fragmentPrefix":""}
133 /// <since_tizen> 3 </since_tizen>
134 [EditorBrowsable(EditorBrowsableState.Never)]
135 [Obsolete("Deprecated in API6; Will be removed in API9.")]
136 public static readonly int PROGRAM = Interop.Shader.ProgramGet();