コード例 #1
0
 public static void LoadShaders()
 {
     try
     {
         EmbossVertexShader   = GLShader.FromFile(ShaderType.VertexShader, "emboss.vp");
         EmbossFragmentShader = GLShader.FromFile(ShaderType.FragmentShader, "emboss.fp");
         EmbossProgram        = GLProgram.Create();
         EmbossProgram.Attach(EmbossVertexShader);
         EmbossProgram.Attach(EmbossFragmentShader);
         EmbossProgram.Link();
     }
     catch
     {
         MessageBox.Show(
             "A problem occured while loading the emboss shader program. Make sure the emboss.vp and emboss.fp files are in the directory of the executable and do not contain syntax errors.",
             "Failed to load emboss shader",
             MessageBoxButtons.OK,
             MessageBoxIcon.Error
             );
         return;
     }
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: arookas/Demolisher
 public static void LoadShaders()
 {
     try
     {
         EmbossVertexShader = GLShader.FromFile(ShaderType.VertexShader, "emboss.vp");
         EmbossFragmentShader = GLShader.FromFile(ShaderType.FragmentShader, "emboss.fp");
         EmbossProgram = GLProgram.Create();
         EmbossProgram.Attach(EmbossVertexShader);
         EmbossProgram.Attach(EmbossFragmentShader);
         EmbossProgram.Link();
     }
     catch
     {
         MessageBox.Show(
             "A problem occured while loading the emboss shader program. Make sure the emboss.vp and emboss.fp files are in the directory of the executable and do not contain syntax errors.",
             "Failed to load emboss shader",
             MessageBoxButtons.OK,
             MessageBoxIcon.Error
         );
         return;
     }
 }