2012-08-09 09:45:04 +00:00
|
|
|
#region Private Members
|
2011-11-15 06:46:22 +00:00
|
|
|
using System;
|
2011-11-15 12:11:24 +00:00
|
|
|
using System.Reflection;
|
2011-11-15 06:46:22 +00:00
|
|
|
|
|
|
|
#endregion // Private Members
|
|
|
|
|
2012-08-09 09:45:04 +00:00
|
|
|
// This file is part of the ANX.Framework created by the
|
|
|
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
|
|
|
// For details see: http://anxframework.codeplex.com/license
|
2011-11-15 06:46:22 +00:00
|
|
|
|
|
|
|
namespace StockShaderCodeGenerator
|
|
|
|
{
|
|
|
|
class Program
|
|
|
|
{
|
|
|
|
static void Main(string[] args)
|
|
|
|
{
|
2011-11-15 12:11:24 +00:00
|
|
|
Console.WriteLine("ANX.Framework StockShaderCodeGenerator (sscg) Version " + Assembly.GetExecutingAssembly().GetName().Version);
|
|
|
|
|
|
|
|
string buildFile;
|
|
|
|
|
|
|
|
if (args.Length < 1)
|
|
|
|
{
|
|
|
|
Console.WriteLine("No command line arguments provided. Trying to load build.xml from current directory.");
|
|
|
|
|
2012-08-16 14:03:31 +00:00
|
|
|
//buildFile = "build.xml";
|
|
|
|
buildFile = @"D:\code\csharp\ANX.Framework\shader\Metro\build.xml";
|
2011-11-15 12:11:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
buildFile = args[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
Console.WriteLine("Creating configuration using '{0}' configuration file.", buildFile);
|
|
|
|
|
|
|
|
Configuration.LoadConfiguration(buildFile);
|
|
|
|
|
|
|
|
if (Configuration.ConfigurationValid)
|
|
|
|
{
|
2012-02-20 08:59:13 +00:00
|
|
|
if (Compiler.GenerateShaders())
|
|
|
|
{
|
|
|
|
CodeGenerator.Generate();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Console.WriteLine("error while compiling shaders. Code generation skipped...");
|
|
|
|
}
|
2011-11-16 14:53:42 +00:00
|
|
|
}
|
2011-11-15 12:11:24 +00:00
|
|
|
|
|
|
|
//#if DEBUG
|
|
|
|
// Console.WriteLine("Press enter to exit.");
|
|
|
|
// Console.ReadLine();
|
|
|
|
//#endif
|
2011-11-15 06:46:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|