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