Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
GpuDepthStencilStateSerializer.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 System;
4 
5 using SiliconStudio.Core.Serialization;
6 using SiliconStudio.Core.Serialization.Contents;
7 
8 namespace SiliconStudio.Paradox.Graphics.DataOld
9 {
10  public class GpuDepthStencilStateSerializer : ContentSerializerBase<DepthStencilState>
11  {
13 
15  {
16  this.graphicsDevice = graphicsDevice;
17  }
18 
19  public override void Serialize(ContentSerializerContext context, SerializationStream stream, ref DepthStencilState depthStencilState)
20  {
21  if (context.Mode == ArchiveMode.Deserialize)
22  {
23  var depthStencilStateDescription = default(DepthStencilStateDescription);
24  stream.Serialize(ref depthStencilStateDescription, context.Mode);
25  depthStencilState = DepthStencilState.New(graphicsDevice, depthStencilStateDescription);
26  }
27  else
28  {
29  throw new NotImplementedException();
30  }
31  }
32 
33  public override object Construct(ContentSerializerContext context)
34  {
35  return null;
36  }
37  }
38 }
override void Serialize(ContentSerializerContext context, SerializationStream stream, ref DepthStencilState depthStencilState)
Contains depth-stencil state for the device.
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.
Base class for implementation of SerializationStream.
ArchiveMode
Enumerates the different mode of serialization (either serialization or deserialization).
Definition: ArchiveMode.cs:8