コード例 #1
0
        public FormUpdateVertexShaderField(CSSLTemplate template, ShaderField target)
        {
            InitializeComponent();

            this.template     = template;
            this.clonedTarget = target.Clone() as ShaderField;
        }
コード例 #2
0
        public FormUpdateStructureField(CSSLTemplate template, StructureField target)
        {
            InitializeComponent();

            this.template = template;
            this.target   = target;
        }
コード例 #3
0
        public FormUpdateIntermediateStructure(CSSLTemplate template, IntermediateStructure target)
        {
            InitializeComponent();

            this.template     = template;
            this.clonedTarget = target.Clone() as IntermediateStructure;
        }
コード例 #4
0
ファイル: FormMain.cs プロジェクト: bobbyzhu/CSharpGL
        private void 打开OToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.openFileDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.currentFile = CSSLTemplate.Load(this.openFileDlg.FileName);

                Map2UI(this.currentFile);
            }
        }
コード例 #5
0
ファイル: FormMain.cs プロジェクト: bobbyzhu/CSharpGL
        private void 另存为AToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CSSLTemplate newFile = ((ICloneable)this.currentFile).Clone() as CSSLTemplate;

            if (this.saveFileDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                newFile.Fullname = this.saveFileDlg.FileName;
                newFile.Save();
                this.currentFile = newFile;
            }
        }
コード例 #6
0
        public object Clone()
        {
            CSSLTemplate result = new CSSLTemplate();

            result.ShaderName              = this.ShaderName;
            result.ProgramType             = this.ProgramType;
            result.VertexShaderFieldList   = this.VertexShaderFieldList.Clone() as VertexShaderFieldList;
            result.GeometryShaderFieldList = this.GeometryShaderFieldList.Clone() as GeometryShaderFieldList;
            result.FragmentShaderFieldList = this.FragmentShaderFieldList.Clone() as FragmentShaderFieldList;
            result.StrutureList            = this.StrutureList.Clone() as IntermediateStructureList;

            return(result);
        }
コード例 #7
0
ファイル: FormMain.cs プロジェクト: bobbyzhu/CSharpGL
 private void Map2UI(CSSLTemplate template)
 {
     this.txtShaderName.Text = template.ShaderName;
     {
         for (int index = 0; index < this.cmbShaderProgramType.Items.Count; index++)
         {
             if (this.cmbShaderProgramType.Items[index].ToString() == template.ProgramType.ToString())
             {
                 this.cmbShaderProgramType.SelectedIndex = index;
                 break;
             }
         }
     }
     {
         this.lstVertexShaderField.Items.Clear();
         foreach (var item in template.VertexShaderFieldList)
         {
             this.lstVertexShaderField.Items.Add(item);
         }
     }
     {
         this.lstGeometryShaderField.Items.Clear();
         foreach (var item in template.GeometryShaderFieldList)
         {
             this.lstGeometryShaderField.Items.Add(item);
         }
     }
     {
         this.lstFragmentShaderField.Items.Clear();
         foreach (var item in template.FragmentShaderFieldList)
         {
             this.lstFragmentShaderField.Items.Add(item);
         }
     }
     {
         this.lstStructure.Items.Clear();
         foreach (var item in template.StrutureList)
         {
             this.lstStructure.Items.Add(item);
         }
     }
 }
コード例 #8
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);
        }
コード例 #9
0
ファイル: FormMain.cs プロジェクト: bobbyzhu/CSharpGL
 private void Map2Template(CSSLTemplate cSSLTemplate)
 {
     this.currentFile.ShaderName  = this.txtShaderName.Text;
     this.currentFile.ProgramType = (ShaderProgramType)(this.cmbShaderProgramType.SelectedItem);
     {
         this.currentFile.VertexShaderFieldList.Clear();
         foreach (var item in this.lstVertexShaderField.Items)
         {
             ShaderField shaderField = item as ShaderField;
             this.currentFile.VertexShaderFieldList.Add(shaderField);
         }
     }
     {
         this.currentFile.GeometryShaderFieldList.Clear();
         foreach (var item in this.lstGeometryShaderField.Items)
         {
             ShaderField shaderField = item as ShaderField;
             this.currentFile.GeometryShaderFieldList.Add(shaderField);
         }
     }
     {
         this.currentFile.FragmentShaderFieldList.Clear();
         foreach (var item in this.lstFragmentShaderField.Items)
         {
             ShaderField shaderField = item as ShaderField;
             this.currentFile.FragmentShaderFieldList.Add(shaderField);
         }
     }
     {
         this.currentFile.StrutureList.Clear();
         foreach (var item in this.lstStructure.Items)
         {
             IntermediateStructure structure = item as IntermediateStructure;
             this.currentFile.StrutureList.Add(structure);
         }
     }
 }
コード例 #10
0
        public FormInsertShaderField(CSSLTemplate template)
        {
            InitializeComponent();

            this.template = template;
        }
コード例 #11
0
ファイル: FormMain.cs プロジェクト: bobbyzhu/CSharpGL
        private void 新建NToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.currentFile = new CSSLTemplate();

            Map2UI(this.currentFile);
        }
コード例 #12
0
        public FormInsertIntermediateStructure(CSSLTemplate template)
        {
            InitializeComponent();

            this.template = template;
        }