Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
EffectConverter.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 using SiliconStudio.Core;
5 using SiliconStudio.Core.Serialization.Converters;
6 using SiliconStudio.Paradox.Shaders;
7 
8 namespace SiliconStudio.Paradox.Graphics
9 {
10  internal class EffectConverter : DataConverter<EffectBytecode, Effect>
11  {
12  public override void ConvertFromData(ConverterContext converterContext, EffectBytecode data, ref Effect obj)
13  {
14  var services = converterContext.Tags.Get(ServiceRegistry.ServiceRegistryKey);
15  var graphicsDeviceService = services.GetSafeServiceAs<IGraphicsDeviceService>();
16 
17  obj = new Effect(graphicsDeviceService.GraphicsDevice, data);
18  }
19 
20  public override void ConvertToData(ConverterContext converterContext, ref EffectBytecode data, Effect obj)
21  {
22  throw new System.NotImplementedException();
23  }
24  }
25 }
Base class for converters to/from a data type.
Contains a compiled shader with bytecode for each stage.