public override object Clone()
        {
            FragmentShaderFieldList list = new FragmentShaderFieldList();

            foreach (var item in this)
            {
                list.Add(item.Clone() as ShaderField);
            }

            return(list);
        }
        internal static FragmentShaderFieldList Parse(System.Xml.Linq.XElement xElement)
        {
            if (xElement.Name != typeof(FragmentShaderFieldList).Name)
            {
                throw new Exception();
            }

            var result = new FragmentShaderFieldList();

            foreach (var item in xElement.Elements(typeof(ShaderField).Name))
            {
                result.Add(ShaderField.Parse(item));
            }

            return(result);
        }
Example #3
0
        internal static CSSLTemplate Load(string fullname)
        {
            XElement element = XElement.Load(fullname);

            if (element.Name != typeof(CSSLTemplate).Name)
            {
                throw new Exception();
            }

            CSSLTemplate result = new CSSLTemplate();

            result.ShaderName  = element.Attribute(strShaderName).Value;
            result.ProgramType = (ShaderProgramType)Enum.Parse(
                typeof(ShaderProgramType), element.Attribute(strProgramType).Value);
            result.VertexShaderFieldList   = VertexShaderFieldList.Parse(element.Element(typeof(VertexShaderFieldList).Name));
            result.GeometryShaderFieldList = GeometryShaderFieldList.Parse(element.Element(typeof(GeometryShaderFieldList).Name));
            result.FragmentShaderFieldList = FragmentShaderFieldList.Parse(element.Element(typeof(FragmentShaderFieldList).Name));
            result.StrutureList            = IntermediateStructureList.Parse(element.Element(typeof(IntermediateStructureList).Name));

            result.Fullname = fullname;

            return(result);
        }