Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
DepthStencilStateFactory.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="IDepthStencilState"/>.
9  /// </summary>
11  {
12  /// <summary>
13  /// Initializes a new instance of the <see cref="DepthStencilStateFactory"/> class.
14  /// </summary>
15  /// <param name="device">The device.</param>
16  internal DepthStencilStateFactory(GraphicsDevice device) : base(device)
17  {
18  Default = DepthStencilState.New(device, new DepthStencilStateDescription(true, true)).KeepAliveBy(this);
19  Default.Name = "DepthStencilState.Default";
20 
21  DefaultInverse = DepthStencilState.New(device, new DepthStencilStateDescription(true, true) { DepthBufferFunction = CompareFunction.GreaterEqual }).KeepAliveBy(this);
22  DefaultInverse.Name = "DepthStencilState.DefaultInverse";
23 
24  DepthRead = DepthStencilState.New(device, new DepthStencilStateDescription(true, false)).KeepAliveBy(this);
25  DepthRead.Name = "DepthStencilState.DepthRead";
26 
27  None = DepthStencilState.New(device, new DepthStencilStateDescription(false, false)).KeepAliveBy(this);
28  None.Name = "DepthStencilState.None";
29  }
30 
31  /// <summary>
32  /// A built-in state object with default settings for using a depth stencil buffer.
33  /// </summary>
34  public readonly DepthStencilState Default;
35 
36  /// <summary>
37  /// A built-in state object with default settings using greater comparison for Z.
38  /// </summary>
40 
41  /// <summary>
42  /// A built-in state object with settings for enabling a read-only depth stencil buffer.
43  /// </summary>
44  public readonly DepthStencilState DepthRead;
45 
46  /// <summary>
47  /// A built-in state object with settings for not using a depth stencil buffer.
48  /// </summary>
49  public readonly DepthStencilState None;
50  }
51 }
52 
Contains depth-stencil state for the device.
readonly DepthStencilState Default
A built-in state object with default settings for using a depth stencil buffer.
readonly DepthStencilState DefaultInverse
A built-in state object with default settings using greater comparison for Z.
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 DepthStencilState None
A built-in state object with settings for not using a depth stencil buffer.
Use the default mode depending on the type of the field/property.
readonly DepthStencilState DepthRead
A built-in state object with settings for enabling a read-only depth stencil buffer.