forked from MonoGame/MonoGame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
49 lines (40 loc) · 1.35 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
48
49
// MonoGame - Copyright (C) The MonoGame Team
// This file is subject to the terms and conditions defined in
// file 'LICENSE.txt', which is part of this source code package.
using System;
using Eto;
using Eto.Forms;
namespace MonoGame.Tools.Pipeline
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Styles.Load();
var app = new Application(Platform.Detect);
#if WINDOWS
Xwt.Application.InitializeAsGuest(Xwt.ToolkitType.Wpf);
#elif LINUX
Xwt.Application.InitializeAsGuest(Xwt.ToolkitType.Gtk3);
#endif
app.Style = "PipelineTool";
var win = new MainWindow();
var controller = PipelineController.Create(win);
#if LINUX
Gtk3Wrapper.gtk_application_add_window(Global.ApplicationHandle, win.NativeHandle);
#endif
string project = null;
if (Global.Unix && !Global.Linux)
project = Environment.GetEnvironmentVariable("MONOGAME_PIPELINE_PROJECT");
else if (args != null && args.Length > 0)
project = string.Join(" ", args);
if (!string.IsNullOrEmpty(project))
controller.OpenProject(project);
app.Run(win);
}
}
}