Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
GpuRasterizerStateSerializer.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 GpuRasterizerStateSerializer : ContentSerializerBase<RasterizerState>
11  {
13 
15  {
16  this.graphicsDevice = graphicsDevice;
17  }
18 
19  public override void Serialize(ContentSerializerContext context, SerializationStream stream, ref RasterizerState rasterizerState)
20  {
21  if (context.Mode == ArchiveMode.Deserialize)
22  {
23  var rasterizerStateDescription = default(RasterizerStateDescription);
24  stream.Serialize(ref rasterizerStateDescription, context.Mode);
25  rasterizerState = RasterizerState.New(graphicsDevice, rasterizerStateDescription);
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 }
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.
override void Serialize(ContentSerializerContext context, SerializationStream stream, ref RasterizerState rasterizerState)
ArchiveMode
Enumerates the different mode of serialization (either serialization or deserialization).
Definition: ArchiveMode.cs:8