Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SamplerStateFactory.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using SiliconStudio.Core;
4 
5 namespace SiliconStudio.Paradox.Graphics
6 {
7  /// <summary>
8  /// Base factory for <see cref="SamplerState"/>.
9  /// </summary>
11  {
12  /// <summary>
13  /// Initializes a new instance of the <see cref="SamplerStateFactory"/> class.
14  /// </summary>
15  /// <param name="device">The device.</param>
16  internal SamplerStateFactory(GraphicsDevice device) : base(device)
17  {
18  PointWrap = SamplerState.New(device, new SamplerStateDescription(TextureFilter.Point, TextureAddressMode.Wrap)).KeepAliveBy(this);
19  PointWrap.Name = "SamplerState.PointWrap";
20 
21  PointClamp = SamplerState.New(device, new SamplerStateDescription(TextureFilter.Point, TextureAddressMode.Clamp)).KeepAliveBy(this);
22  PointClamp.Name = "SamplerState.PointClamp";
23 
24  LinearWrap = SamplerState.New(device, new SamplerStateDescription(TextureFilter.Linear, TextureAddressMode.Wrap)).KeepAliveBy(this);
25  LinearWrap.Name = "SamplerState.LinearWrap";
26 
27  LinearClamp = SamplerState.New(device, new SamplerStateDescription(TextureFilter.Linear, TextureAddressMode.Clamp)).KeepAliveBy(this);
28  LinearClamp.Name = "SamplerState.LinearClamp";
29 
30  AnisotropicWrap = SamplerState.New(device, new SamplerStateDescription(TextureFilter.Anisotropic, TextureAddressMode.Wrap)).KeepAliveBy(this);
31  AnisotropicWrap.Name = "SamplerState.AnisotropicWrap";
32 
33  AnisotropicClamp = SamplerState.New(device, new SamplerStateDescription(TextureFilter.Anisotropic, TextureAddressMode.Clamp)).KeepAliveBy(this);
34  AnisotropicClamp.Name = "SamplerState.AnisotropicClamp";
35  }
36 
37  /// <summary>
38  /// Default state for point filtering with texture coordinate wrapping.
39  /// </summary>
40  public readonly SamplerState PointWrap;
41 
42  /// <summary>
43  /// Default state for point filtering with texture coordinate clamping.
44  /// </summary>
45  public readonly SamplerState PointClamp;
46 
47  /// <summary>
48  /// Default state for linear filtering with texture coordinate wrapping.
49  /// </summary>
50  public readonly SamplerState LinearWrap;
51 
52  /// <summary>
53  /// Default state for linear filtering with texture coordinate clamping.
54  /// </summary>
55  public readonly SamplerState LinearClamp;
56 
57  /// <summary>
58  /// Default state for anisotropic filtering with texture coordinate wrapping.
59  /// </summary>
60  public readonly SamplerState AnisotropicWrap;
61 
62  /// <summary>
63  /// Default state for anisotropic filtering with texture coordinate clamping.
64  /// </summary>
65  public readonly SamplerState AnisotropicClamp;
66  }
67 }
68 
TextureAddressMode
Identify a technique for resolving texture coordinates that are outside of the boundaries of a textur...
TextureFilter
Filtering options during texture sampling.
readonly SamplerState AnisotropicWrap
Default state for anisotropic filtering with texture coordinate wrapping.
Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and creates shaders. See The+GraphicsDevice+class to learn more about the class.
readonly SamplerState LinearClamp
Default state for linear filtering with texture coordinate clamping.
readonly SamplerState AnisotropicClamp
Default state for anisotropic filtering with texture coordinate clamping.
readonly SamplerState PointWrap
Default state for point filtering with texture coordinate wrapping.
readonly SamplerState PointClamp
Default state for point filtering with texture coordinate clamping.
readonly SamplerState LinearWrap
Default state for linear filtering with texture coordinate wrapping.