2 using Paradox.Framework.Diagnostics;
3 using Paradox.Framework.Serialization;
4 using Paradox.Framework.Serialization.Contents;
6 namespace Paradox.Framework.Graphics.Data
10 private readonly GraphicsDevice graphicsDevice;
14 this.graphicsDevice = graphicsDevice;
17 public override void Serialize(ContentSerializerContext context, ref Texture texture, ref
object intermediateData)
19 if (context.RootContext.ArchiveMode ==
ArchiveMode.Serialize)
20 throw new NotImplementedException();
22 var textureData = context.RootContext.AssetManager.Load<Image>(context.Url);
25 texture = Texture.New(graphicsDevice, textureData);
29 Logger.GetLogger(
"GPUTexture").Error(
"Unable to load Texture {0}. See Debug for more information", ex, context.Url);
33 context.RootContext.AssetManager.Unload(textureData);
37 public override object Construct(ContentSerializerContext context)
override object Construct(ContentSerializerContext context)
ArchiveMode
Enumerates the different mode of serialization (either serialization or deserialization).
override void Serialize(ContentSerializerContext context, ref Texture texture, ref object intermediateData)
GpuTextureSerializer(GraphicsDevice graphicsDevice)