public void ImportFile(string srcFile, string targetName, string targetDir) { string ext = Path.GetExtension(srcFile).ToLower(); string[] output = this.GetOutputFiles(srcFile, targetName, targetDir); if (ext == ".vert") { VertexShader res = new VertexShader(); res.LoadSource(srcFile); res.Compile(); res.Save(output[0]); } else if (ext == ".frag") { FragmentShader res = new FragmentShader(); res.LoadSource(srcFile); res.Compile(); res.Save(output[0]); } else { GeometryShader res = new GeometryShader(); res.LoadSource(srcFile); res.Compile(); res.Save(output[0]); } }
public void ImportFile(string srcFile, string targetName, string targetDir) { string ext = Path.GetExtension(srcFile); string[] output = this.GetOutputFiles(srcFile, targetName, targetDir); if (string.Equals(ext, SourceFileExtVertex, StringComparison.InvariantCultureIgnoreCase)) { VertexShader res = new VertexShader(); res.LoadSource(srcFile); res.Compile(); res.Save(output[0]); } else { FragmentShader res = new FragmentShader(); res.LoadSource(srcFile); res.Compile(); res.Save(output[0]); } }