[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shader_New__SWIG_1")]
public static extern global::System.IntPtr New(string jarg1, string jarg2);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Shader_New__SWIG_2")]
+ public static extern global::System.IntPtr New(string vertexShaderCode, string fragmentShaderCode, int hints, string shaderName);
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_Shader")]
public static extern void DeleteShader(global::System.Runtime.InteropServices.HandleRef jarg1);
}
return ret;
}
+ /// <summary>
+ /// Finds the value for the specified string key if it exists.
+ /// </summary>
+ /// <param name="stringKey">The string key to find.</param>
+ /// <returns>The value if it exists, an empty object otherwise.</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public PropertyValue Find(string stringKey)
+ {
+ global::System.IntPtr cPtr = Interop.PropertyMap.Find(SwigCPtr, stringKey);
+ PropertyValue ret = (cPtr == global::System.IntPtr.Zero) ? null : new PropertyValue(cPtr, false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
/// <summary>
/// Finds the value for the specified key if it exists.
/// </summary>
/// <param name="fragmentShader">The fragment Shader code for the effect.</param>
/// <param name="hints">The hints to define the geometry of the rendered object.</param>
/// <since_tizen> 3 </since_tizen>
- public Shader(string vertexShader, string fragmentShader, Shader.Hint.Value hints) : this(Interop.Shader.New(vertexShader, fragmentShader, (int)hints), true)
+ public Shader(string vertexShader, string fragmentShader, Shader.Hint.Value hints) : this(vertexShader, fragmentShader, hints, "")
{
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// <param name="vertexShader">The vertex shader code for the effect.</param>
/// <param name="fragmentShader">The fragment Shader code for the effect.</param>
/// <since_tizen> 3 </since_tizen>
- public Shader(string vertexShader, string fragmentShader) : this(Interop.Shader.New(vertexShader, fragmentShader), true)
+ public Shader(string vertexShader, string fragmentShader) : this(vertexShader, fragmentShader, Shader.Hint.Value.NONE, "")
+ {
+ }
+
+ /// <summary>
+ /// Creates Shader object with name
+ /// </summary>
+ /// <param name="vertexShader">The vertex shader code for the effect.</param>
+ /// <param name="fragmentShader">The fragment Shader code for the effect.</param>
+ /// <param name="shaderName">The name of this shader object.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Shader(string vertexShader, string fragmentShader, string shaderName) : this(vertexShader, fragmentShader, Shader.Hint.Value.NONE, shaderName)
{
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
{
var temp = new Tizen.NUI.PropertyValue(value);
Tizen.NUI.Object.SetProperty(SwigCPtr, Shader.Property.PROGRAM, temp);
+
+ // Update shader name
+ Name = "";
+ if (value != null)
+ {
+ using var nameValue = value.Find("name");
+ if (nameValue?.Get(out string name) ?? false)
+ {
+ Name = name ?? "";
+ }
+ }
temp.Dispose();
}
}
+ /// <summary>
+ /// Gets the name of program.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string Name { get; private set; }
+
+ internal Shader(string vertexShader, string fragmentShader, Shader.Hint.Value hints, string shaderName) : this(Interop.Shader.New(vertexShader, fragmentShader, (int)hints, shaderName ?? ""), true)
+ {
+ Name = shaderName ?? "";
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
internal Shader(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
}