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.
21 /// TextureSet is a handle to an object that specifies the set of images used as textures by a renderer.<br />
22 /// The images have to be ordered in the same order they are declared in the shader.
24 /// <since_tizen> 3 </since_tizen>
25 public class TextureSet : BaseHandle
27 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
29 internal TextureSet(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextureSet_SWIGUpcast(cPtr), cMemoryOwn)
31 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
34 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextureSet obj)
36 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
42 /// <since_tizen> 3 </since_tizen>
43 protected override void Dispose(DisposeTypes type)
50 if (type == DisposeTypes.Explicit)
53 //Release your own managed resources here.
54 //You should release all of your own disposable objects here.
58 //Release your own unmanaged resources here.
59 //You should not access any managed member here except static instance.
60 //because the execution order of Finalizes is non-deterministic.
62 if (swigCPtr.Handle != global::System.IntPtr.Zero)
67 NDalicPINVOKE.delete_TextureSet(swigCPtr);
69 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
76 /// Create an instance of TextureSet.
78 /// <since_tizen> 3 </since_tizen>
79 public TextureSet() : this(NDalicPINVOKE.TextureSet_New(), true)
81 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
86 /// Sets the texture at position "index".
88 /// <param name="index">The position in the texture set of the texture.</param>
89 /// <param name="texture">The texture.</param>
90 /// <since_tizen> 3 </since_tizen>
91 public void SetTexture(uint index, Texture texture)
93 NDalicPINVOKE.TextureSet_SetTexture(swigCPtr, index, Texture.getCPtr(texture));
94 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
98 /// Gets the image at position "index".
100 /// <param name="index">The position in the texture set of the image.</param>
101 /// <returns>A handle to the image at the the specified position.</returns>
102 /// <since_tizen> 3 </since_tizen>
103 public Texture GetTexture(uint index)
105 System.IntPtr cPtr = NDalicPINVOKE.TextureSet_GetTexture(swigCPtr, index);
106 Texture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Texture;
108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
113 /// Sets the sampler to be used by the image at position "index".
115 /// <param name="index">The position in the texture set of the image.</param>
116 /// <param name="sampler">The sampler to use.</param>
117 /// <since_tizen> 3 </since_tizen>
118 public void SetSampler(uint index, Sampler sampler)
120 NDalicPINVOKE.TextureSet_SetSampler(swigCPtr, index, Sampler.getCPtr(sampler));
121 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
125 /// Sets the sampler to be used by the image at position "index".
127 /// <param name="index">The position in the texture set of the image.</param>
128 /// <returns>A handle to the sampler at the specified position.</returns>
129 /// <since_tizen> 3 </since_tizen>
130 public Sampler GetSampler(uint index)
132 System.IntPtr cPtr = NDalicPINVOKE.TextureSet_GetSampler(swigCPtr, index);
133 Sampler ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Sampler;
135 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140 /// Gets the number of textures present in the TextureSet.
142 /// <returns>The number of textures in the TextureSet.</returns>
143 /// <since_tizen> 3 </since_tizen>
144 public uint GetTextureCount()
146 uint ret = NDalicPINVOKE.TextureSet_GetTextureCount(swigCPtr);
147 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();