/*
* Copyright(c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System.ComponentModel;
namespace Tizen.NUI
{
///
/// Sampler is a handle to an object that can be used to provide the sampling parameters to sample textures.
///
/// 3
public class Sampler : BaseHandle
{
///
/// Create an instance of Sampler.
///
/// 3
public Sampler() : this(Interop.Sampler.New(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Sets the filter modes for this sampler.
///
/// The minification filter that will be used.
/// The magnification filter that will be used.
/// 3
public void SetFilterMode(FilterModeType minFilter, FilterModeType magFilter)
{
Interop.Sampler.SetFilterMode(SwigCPtr, (int)minFilter, (int)magFilter);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Sets the wrap modes for this sampler.
///
/// Wrap mode for u coordinates.
/// Wrap mode for v coordinates.
/// 3
public void SetWrapMode(WrapModeType uWrap, WrapModeType vWrap)
{
Interop.Sampler.SetWrapMode(SwigCPtr, (int)uWrap, (int)vWrap);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Sets the wrap modes for this sampler.
///
/// Wrap mode for the x direction.
/// Wrap mode for the y direction.
/// Wrap mode for the z direction.
/// 3
public void SetWrapMode(WrapModeType rWrap, WrapModeType sWrap, WrapModeType tWrap)
{
Interop.Sampler.SetWrapMode(SwigCPtr, (int)rWrap, (int)sWrap, (int)tWrap);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Sampler obj)
{
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
}
internal Sampler(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Sampler.Upcast(cPtr), cMemoryOwn)
{
}
/// This will not be public opened.
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
Interop.Sampler.DeleteSampler(swigCPtr);
}
}
}