-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
47 lines (44 loc) · 1.18 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using Chel.Render;
namespace Chel;
public class Program
{
const string DEFAULT_PACK = @"RenderPacks\OrthographicWireframe.yml";
const string DEFAULT_MODEL = @"Models\5cell.styl";
public static void Main(string[] args)
{
string pack = DEFAULT_PACK;
string model = DEFAULT_MODEL;
switch(args.Length)
{
case 0:
break;
case 1 :
pack = args[0];
break;
case 2 :
pack = args[0];
model = args[1];
break;
default :
Console.WriteLine("ERROR: Invalid argument construction");
return;
}
try
{
using(RenderWindow rw = new(800,600,"Chel",pack,model))
{
rw.Run();
}
}
catch(FileNotFoundException e)
{
Console.WriteLine($"ERROR: File {e.FileName} not found");
return;
}
catch(Exception e)
{
Console.WriteLine($"ERROR: An exception has occured and the program has been killed");
Console.WriteLine(e.Message);
}
}
}