Esempio n. 1
0
 void onApplyShader(object sender, EventArgs e)
 {
     if (EditedShader != null)
     {
         EditedShader.Compile();
     }
 }
Esempio n. 2
0
        void onSaveShader(object sender, EventArgs e)
        {
            if (EditedShader == null)
            {
                return;
            }
            string path = EditedShader.GetSourcePath(shaderType);

            if (string.IsNullOrEmpty(path))
            {
                return;
            }
            using (Stream s = new FileStream(path, FileMode.Create)) {
                byte[] buff = System.Text.Encoding.ASCII.GetBytes(EditedShader.GetSource(shaderType));
                s.Write(buff, 0, buff.Length);
            }
        }