1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
20 /// TextureSet is a handle to an object that specifies the set of images used as textures by a renderer.<br>
21 /// The images have to be ordered in the same order they are declared in the shader.
23 public class TextureSet : BaseHandle
25 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27 internal TextureSet(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextureSet_SWIGUpcast(cPtr), cMemoryOwn)
29 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
32 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextureSet obj)
34 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
37 protected override void Dispose(DisposeTypes type)
44 if (type == DisposeTypes.Explicit)
47 //Release your own managed resources here.
48 //You should release all of your own disposable objects here.
52 //Release your own unmanaged resources here.
53 //You should not access any managed member here except static instance.
54 //because the execution order of Finalizes is non-deterministic.
56 if (swigCPtr.Handle != global::System.IntPtr.Zero)
61 NDalicPINVOKE.delete_TextureSet(swigCPtr);
63 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
70 /// Create an instance of TextureSet.
72 /// <since_tizen> 3 </since_tizen>
73 public TextureSet() : this(NDalicPINVOKE.TextureSet_New(), true)
75 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
80 /// Sets the texture at position "index".
82 /// <param name="index">The position in the texture set of the texture.</param>
83 /// <param name="texture">The texture.</param>
84 /// <since_tizen> 3 </since_tizen>
85 public void SetTexture(uint index, Texture texture)
87 NDalicPINVOKE.TextureSet_SetTexture(swigCPtr, index, Texture.getCPtr(texture));
88 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
92 /// Gets the image at position "index".
94 /// <param name="index">The position in the texture set of the image.</param>
95 /// <returns>A handle to the image at the the specified position.</returns>
96 /// <since_tizen> 3 </since_tizen>
97 public Texture GetTexture(uint index)
99 System.IntPtr cPtr = NDalicPINVOKE.TextureSet_GetTexture(swigCPtr, index);
100 Texture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Texture;
102 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
107 /// Sets the sampler to be used by the image at position "index".
109 /// <param name="index">The position in the texture set of the image.</param>
110 /// <param name="sampler">The sampler to use.</param>
111 /// <since_tizen> 3 </since_tizen>
112 public void SetSampler(uint index, Sampler sampler)
114 NDalicPINVOKE.TextureSet_SetSampler(swigCPtr, index, Sampler.getCPtr(sampler));
115 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119 /// Sets the sampler to be used by the image at position "index".
121 /// <param name="index">The position in the texture set of the image.</param>
122 /// <returns>A handle to the sampler at the specified position.</returns>
123 /// <since_tizen> 3 </since_tizen>
124 public Sampler GetSampler(uint index)
126 System.IntPtr cPtr = NDalicPINVOKE.TextureSet_GetSampler(swigCPtr, index);
127 Sampler ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Sampler;
129 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134 /// Gets the number of textures present in the TextureSet.
136 /// <returns>The number of textures in the TextureSet.</returns>
137 /// <since_tizen> 3 </since_tizen>
138 public uint GetTextureCount()
140 uint ret = NDalicPINVOKE.TextureSet_GetTextureCount(swigCPtr);
141 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();