Show More
Commit Description:
Add missing component and message.
Commit Description:
Add missing component and message.
References:
File last commit:
Show/Diff file:
Action:
FNA/src/Graphics/States/SamplerState.cs
193 lines | 3.3 KiB | text/x-csharp | CSharpLexer
193 lines | 3.3 KiB | text/x-csharp | CSharpLexer
r0 | #region License | |||
/* FNA - XNA4 Reimplementation for Desktop Platforms | ||||
r690 | * Copyright 2009-2022 Ethan Lee and the MonoGame Team | |||
r0 | * | |||
* Released under the Microsoft Public License. | ||||
* See LICENSE for details. | ||||
*/ | ||||
#endregion | ||||
namespace Microsoft.Xna.Framework.Graphics | ||||
{ | ||||
public class SamplerState : GraphicsResource | ||||
{ | ||||
#region Public Properties | ||||
public TextureAddressMode AddressU | ||||
{ | ||||
r690 | get | |||
{ | ||||
return state.addressU; | ||||
} | ||||
set | ||||
{ | ||||
state.addressU = value; | ||||
} | ||||
r0 | } | |||
public TextureAddressMode AddressV | ||||
{ | ||||
r690 | get | |||
{ | ||||
return state.addressV; | ||||
} | ||||
set | ||||
{ | ||||
state.addressV = value; | ||||
} | ||||
r0 | } | |||
public TextureAddressMode AddressW | ||||
{ | ||||
r690 | get | |||
{ | ||||
return state.addressW; | ||||
} | ||||
set | ||||
{ | ||||
state.addressW = value; | ||||
} | ||||
r0 | } | |||
public TextureFilter Filter | ||||
{ | ||||
r690 | get | |||
{ | ||||
return state.filter; | ||||
} | ||||
set | ||||
{ | ||||
state.filter = value; | ||||
} | ||||
r0 | } | |||
public int MaxAnisotropy | ||||
{ | ||||
r690 | get | |||
{ | ||||
return state.maxAnisotropy; | ||||
} | ||||
set | ||||
{ | ||||
state.maxAnisotropy = value; | ||||
} | ||||
r0 | } | |||
public int MaxMipLevel | ||||
{ | ||||
r690 | get | |||
{ | ||||
return state.maxMipLevel; | ||||
} | ||||
set | ||||
{ | ||||
state.maxMipLevel = value; | ||||
} | ||||
r0 | } | |||
public float MipMapLevelOfDetailBias | ||||
{ | ||||
r690 | get | |||
{ | ||||
return state.mipMapLevelOfDetailBias; | ||||
} | ||||
set | ||||
{ | ||||
state.mipMapLevelOfDetailBias = value; | ||||
} | ||||
r0 | } | |||
#endregion | ||||
#region Public SamplerState Presets | ||||
public static readonly SamplerState AnisotropicClamp = new SamplerState( | ||||
"SamplerState.AnisotropicClamp", | ||||
TextureFilter.Anisotropic, | ||||
TextureAddressMode.Clamp, | ||||
TextureAddressMode.Clamp, | ||||
TextureAddressMode.Clamp | ||||
); | ||||
public static readonly SamplerState AnisotropicWrap = new SamplerState( | ||||
"SamplerState.AnisotropicWrap", | ||||
TextureFilter.Anisotropic, | ||||
TextureAddressMode.Wrap, | ||||
TextureAddressMode.Wrap, | ||||
TextureAddressMode.Wrap | ||||
); | ||||
public static readonly SamplerState LinearClamp = new SamplerState( | ||||
"SamplerState.LinearClamp", | ||||
TextureFilter.Linear, | ||||
TextureAddressMode.Clamp, | ||||
TextureAddressMode.Clamp, | ||||
TextureAddressMode.Clamp | ||||
); | ||||
public static readonly SamplerState LinearWrap = new SamplerState( | ||||
"SamplerState.LinearWrap", | ||||
TextureFilter.Linear, | ||||
TextureAddressMode.Wrap, | ||||
TextureAddressMode.Wrap, | ||||
TextureAddressMode.Wrap | ||||
); | ||||
public static readonly SamplerState PointClamp = new SamplerState( | ||||
"SamplerState.PointClamp", | ||||
TextureFilter.Point, | ||||
TextureAddressMode.Clamp, | ||||
TextureAddressMode.Clamp, | ||||
TextureAddressMode.Clamp | ||||
); | ||||
public static readonly SamplerState PointWrap = new SamplerState( | ||||
"SamplerState.PointWrap", | ||||
TextureFilter.Point, | ||||
TextureAddressMode.Wrap, | ||||
TextureAddressMode.Wrap, | ||||
TextureAddressMode.Wrap | ||||
); | ||||
#endregion | ||||
r690 | #region Internal FNA3D Variables | |||
internal FNA3D.FNA3D_SamplerState state; | ||||
#endregion | ||||
r0 | #region Public Constructor | |||
public SamplerState() | ||||
{ | ||||
Filter = TextureFilter.Linear; | ||||
AddressU = TextureAddressMode.Wrap; | ||||
AddressV = TextureAddressMode.Wrap; | ||||
AddressW = TextureAddressMode.Wrap; | ||||
MaxAnisotropy = 4; | ||||
MaxMipLevel = 0; | ||||
MipMapLevelOfDetailBias = 0.0f; | ||||
} | ||||
#endregion | ||||
#region Private Constructor | ||||
private SamplerState( | ||||
string name, | ||||
TextureFilter filter, | ||||
TextureAddressMode addressU, | ||||
TextureAddressMode addressV, | ||||
TextureAddressMode addressW | ||||
) : this() { | ||||
Name = name; | ||||
Filter = filter; | ||||
AddressU = addressU; | ||||
AddressV = addressV; | ||||
AddressW = addressW; | ||||
} | ||||
#endregion | ||||
} | ||||
} | ||||