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