From 02874c9c22a2d8400622f5670e46392d36314ea1 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 18 Mar 2020 15:42:37 +0100 Subject: [PATCH] library: texture: enum: add deserialization --- src/texture/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/texture/mod.rs b/src/texture/mod.rs index 1c1504c..64aa44d 100644 --- a/src/texture/mod.rs +++ b/src/texture/mod.rs @@ -1,10 +1,14 @@ use super::core::LinearColor; use super::Point2D; +use serde::Deserialize; /// All the existing `Texture` implementation. +#[serde(tag = "type")] +#[serde(rename_all = "lowercase")] #[enum_dispatch::enum_dispatch] -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Deserialize)] pub enum TextureEnum { + #[serde(rename = "uniform")] UniformTexture, }