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 public class TextureSet : BaseHandle
26 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
28 internal TextureSet(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextureSet_SWIGUpcast(cPtr), cMemoryOwn)
30 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
33 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextureSet obj)
35 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
41 /// <since_tizen> 3 </since_tizen>
42 protected override void Dispose(DisposeTypes type)
49 if (type == DisposeTypes.Explicit)
52 //Release your own managed resources here.
53 //You should release all of your own disposable objects here.
57 //Release your own unmanaged resources here.
58 //You should not access any managed member here except static instance.
59 //because the execution order of Finalizes is non-deterministic.
61 if (swigCPtr.Handle != global::System.IntPtr.Zero)
66 NDalicPINVOKE.delete_TextureSet(swigCPtr);
68 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
75 /// Create an instance of TextureSet.
77 /// <since_tizen> 3 </since_tizen>
78 public TextureSet() : this(NDalicPINVOKE.TextureSet_New(), true)
80 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
85 /// Sets the texture at position "index".
87 /// <param name="index">The position in the texture set of the texture.</param>
88 /// <param name="texture">The texture.</param>
89 /// <since_tizen> 3 </since_tizen>
90 public void SetTexture(uint index, Texture texture)
92 NDalicPINVOKE.TextureSet_SetTexture(swigCPtr, index, Texture.getCPtr(texture));
93 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
97 /// Gets the image at position "index".
99 /// <param name="index">The position in the texture set of the image.</param>
100 /// <returns>A handle to the image at the the specified position.</returns>
101 /// <since_tizen> 3 </since_tizen>
102 public Texture GetTexture(uint index)
104 System.IntPtr cPtr = NDalicPINVOKE.TextureSet_GetTexture(swigCPtr, index);
105 Texture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Texture;
107 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
112 /// Sets the sampler to be used by the image at position "index".
114 /// <param name="index">The position in the texture set of the image.</param>
115 /// <param name="sampler">The sampler to use.</param>
116 /// <since_tizen> 3 </since_tizen>
117 public void SetSampler(uint index, Sampler sampler)
119 NDalicPINVOKE.TextureSet_SetSampler(swigCPtr, index, Sampler.getCPtr(sampler));
120 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
124 /// Sets the sampler to be used by the image at position "index".
126 /// <param name="index">The position in the texture set of the image.</param>
127 /// <returns>A handle to the sampler at the specified position.</returns>
128 /// <since_tizen> 3 </since_tizen>
129 public Sampler GetSampler(uint index)
131 System.IntPtr cPtr = NDalicPINVOKE.TextureSet_GetSampler(swigCPtr, index);
132 Sampler ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Sampler;
134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
139 /// Gets the number of textures present in the TextureSet.
141 /// <returns>The number of textures in the TextureSet.</returns>
142 /// <since_tizen> 3 </since_tizen>
143 public uint GetTextureCount()
145 uint ret = NDalicPINVOKE.TextureSet_GetTextureCount(swigCPtr);
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();