示例#1
0
 public CSSLTemplate()
 {
     this.ShaderName              = "SomeShader";
     this.ProgramType             = ShaderProgramType.VertexFragment;
     this.VertexShaderFieldList   = new VertexShaderFieldList();
     this.GeometryShaderFieldList = new GeometryShaderFieldList();
     this.FragmentShaderFieldList = new FragmentShaderFieldList();
     this.StrutureList            = new IntermediateStructureList();
 }
示例#2
0
        public object Clone()
        {
            IntermediateStructureList list = new IntermediateStructureList();

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

            return(list);
        }
示例#3
0
        internal static IntermediateStructureList Parse(XElement xElement)
        {
            if (xElement.Name != typeof(IntermediateStructureList).Name)
            {
                throw new Exception();
            }

            IntermediateStructureList list = new IntermediateStructureList();

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

            return(list);
        }
示例#4
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);
        }