[Bind] Remove dirName

Wasn't used, always ended up as "GL2"
This commit is contained in:
Fraser Waters 2015-06-07 23:01:46 +01:00
parent e6e8b7a357
commit 72cc73f2bf
9 changed files with 34 additions and 38 deletions

View file

@ -11,8 +11,8 @@ namespace Bind.CL
{ {
class CLGenerator : ES.ESGenerator class CLGenerator : ES.ESGenerator
{ {
public CLGenerator(Settings settings, string dirname) public CLGenerator(Settings settings)
: base(settings, dirname) : base(settings)
{ {
glTypemap = null; glTypemap = null;

View file

@ -12,8 +12,8 @@ namespace Bind.ES
// Generation implementation for OpenGL ES 2.0 and 3.0 // Generation implementation for OpenGL ES 2.0 and 3.0
class ES2Generator : Generator class ES2Generator : Generator
{ {
public ES2Generator(Settings settings, string dirName) public ES2Generator(Settings settings)
: base(settings, dirName) : base(settings)
{ {
Settings.DefaultOutputPath = Path.Combine( Settings.DefaultOutputPath = Path.Combine(
Settings.DefaultOutputPath, "../ES20"); Settings.DefaultOutputPath, "../ES20");

View file

@ -12,8 +12,8 @@ namespace Bind.ES
// Generation implementation for OpenGL ES 3.1 // Generation implementation for OpenGL ES 3.1
class ES31Generator : Generator class ES31Generator : Generator
{ {
public ES31Generator(Settings settings, string dirName) public ES31Generator(Settings settings)
: base(settings, dirName) : base(settings)
{ {
Settings.DefaultOutputPath = Path.Combine( Settings.DefaultOutputPath = Path.Combine(
Settings.DefaultOutputPath, "../ES31"); Settings.DefaultOutputPath, "../ES31");

View file

@ -12,8 +12,8 @@ namespace Bind.ES
// Generation implementation for OpenGL ES 3.0 // Generation implementation for OpenGL ES 3.0
class ES3Generator : Generator class ES3Generator : Generator
{ {
public ES3Generator(Settings settings, string dirName) public ES3Generator(Settings settings)
: base(settings, dirName) : base(settings)
{ {
Settings.DefaultOutputPath = Path.Combine( Settings.DefaultOutputPath = Path.Combine(
Settings.DefaultOutputPath, "../ES30"); Settings.DefaultOutputPath, "../ES30");

View file

@ -12,8 +12,8 @@ namespace Bind.ES
// Generator implementation for OpenGL ES 1.0 and 1.1 // Generator implementation for OpenGL ES 1.0 and 1.1
class ESGenerator : Generator class ESGenerator : Generator
{ {
public ESGenerator(Settings settings, string dirName) public ESGenerator(Settings settings)
: base(settings, dirName) : base(settings)
{ {
Settings.DefaultOutputPath = Path.Combine( Settings.DefaultOutputPath = Path.Combine(
Settings.DefaultOutputPath, "../ES11"); Settings.DefaultOutputPath, "../ES11");

View file

@ -35,8 +35,8 @@ namespace Bind.GL2
class GL2Generator : Generator class GL2Generator : Generator
{ {
public GL2Generator(Settings settings, string dirname) public GL2Generator(Settings settings)
: base(settings, dirname) : base(settings)
{ {
if (Settings.Compatibility == Settings.Legacy.Tao) if (Settings.Compatibility == Settings.Legacy.Tao)
{ {

View file

@ -35,8 +35,8 @@ namespace Bind.GL2
{ {
class GL4Generator : Generator class GL4Generator : Generator
{ {
public GL4Generator(Settings settings, string dirname) public GL4Generator(Settings settings)
: base(settings, dirname) : base(settings)
{ {
Settings.DefaultOutputPath = Path.Combine( Settings.DefaultOutputPath = Path.Combine(
Settings.DefaultOutputPath, "../OpenGL4"); Settings.DefaultOutputPath, "../OpenGL4");

View file

@ -60,21 +60,19 @@ namespace Bind.GL2
#region Constructors #region Constructors
public Generator(Settings settings, string dirName) public Generator(Settings settings)
{ {
if (settings == null) if (settings == null)
throw new ArgumentNullException("settings"); throw new ArgumentNullException("settings");
if (dirName == null)
dirName = "GL2";
Settings = settings.Clone(); Settings = settings.Clone();
glTypemap = "GL2/gl.tm"; glTypemap = "GL2/gl.tm";
csTypemap = Settings.LanguageTypeMapFile; csTypemap = Settings.LanguageTypeMapFile;
enumSpec = Path.Combine(dirName, "signatures.xml"); enumSpec = Path.Combine("GL2", "signatures.xml");
enumSpecExt = String.Empty; enumSpecExt = String.Empty;
glSpec = Path.Combine(dirName, "signatures.xml"); glSpec = Path.Combine("GL2", "signatures.xml");
glSpecExt = String.Empty; glSpecExt = String.Empty;
Settings.ImportsClass = "Core"; Settings.ImportsClass = "Core";

View file

@ -52,9 +52,7 @@ namespace Bind
Assembly.GetExecutingAssembly().GetName().Version.ToString()); Assembly.GetExecutingAssembly().GetName().Version.ToString());
Console.WriteLine("For comments, bugs and suggestions visit http://github.com/opentk/opentk"); Console.WriteLine("For comments, bugs and suggestions visit http://github.com/opentk/opentk");
Console.WriteLine(); Console.WriteLine();
string dirName = "GL2";
try try
{ {
var split = new Regex(@"-\w+", RegexOptions.Compiled); var split = new Regex(@"-\w+", RegexOptions.Compiled);
@ -83,7 +81,7 @@ namespace Bind
case "mode": case "mode":
{ {
string arg = val.ToLower(); string arg = val.ToLower();
SetGeneratorMode(dirName, arg); SetGeneratorMode(arg);
break; break;
} }
case "namespace": case "namespace":
@ -154,45 +152,45 @@ namespace Bind
case GeneratorMode.All: case GeneratorMode.All:
Console.WriteLine("Using 'all' generator mode."); Console.WriteLine("Using 'all' generator mode.");
Console.WriteLine("Use '-mode:all/gl2/gl4/es10/es11/es20/es30/es31' to select a specific mode."); Console.WriteLine("Use '-mode:all/gl2/gl4/es10/es11/es20/es30/es31' to select a specific mode.");
Generators.Add(new GL2Generator(Settings, dirName)); Generators.Add(new GL2Generator(Settings));
Generators.Add(new GL4Generator(Settings, dirName)); Generators.Add(new GL4Generator(Settings));
Generators.Add(new ESGenerator(Settings, dirName)); Generators.Add(new ESGenerator(Settings));
Generators.Add(new ES2Generator(Settings, dirName)); Generators.Add(new ES2Generator(Settings));
Generators.Add(new ES3Generator(Settings, dirName)); Generators.Add(new ES3Generator(Settings));
Generators.Add(new ES31Generator(Settings, dirName)); Generators.Add(new ES31Generator(Settings));
break; break;
case GeneratorMode.GL2: case GeneratorMode.GL2:
Generators.Add(new GL2Generator(Settings, dirName)); Generators.Add(new GL2Generator(Settings));
break; break;
case GeneratorMode.GL3: case GeneratorMode.GL3:
case GeneratorMode.GL4: case GeneratorMode.GL4:
Generators.Add(new GL4Generator(Settings, dirName)); Generators.Add(new GL4Generator(Settings));
break; break;
case GeneratorMode.ES10: case GeneratorMode.ES10:
Generators.Add(new ESGenerator(Settings, dirName)); Generators.Add(new ESGenerator(Settings));
break; break;
case GeneratorMode.ES11: case GeneratorMode.ES11:
Generators.Add(new ESGenerator(Settings, dirName)); Generators.Add(new ESGenerator(Settings));
break; break;
case GeneratorMode.ES20: case GeneratorMode.ES20:
Generators.Add(new ES2Generator(Settings, dirName)); Generators.Add(new ES2Generator(Settings));
break; break;
case GeneratorMode.ES30: case GeneratorMode.ES30:
Generators.Add(new ES3Generator(Settings, dirName)); Generators.Add(new ES3Generator(Settings));
break; break;
case GeneratorMode.ES31: case GeneratorMode.ES31:
Generators.Add(new ES31Generator(Settings, dirName)); Generators.Add(new ES31Generator(Settings));
break; break;
case GeneratorMode.CL10: case GeneratorMode.CL10:
Generators.Add(new CLGenerator(Settings, dirName)); Generators.Add(new CLGenerator(Settings));
break; break;
default: default:
@ -234,7 +232,7 @@ namespace Bind
} }
} }
private static void SetGeneratorMode(string dirName, string arg) private static void SetGeneratorMode(string arg)
{ {
switch (arg) switch (arg)
{ {