-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
51 lines (41 loc) · 1.73 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
50
51
using System;
using System.Net;
using Aragas.Core.Wrappers;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MineLib.PGL;
using MineLib.Windows.WrapperInstances;
namespace MineLib.Windows
{
public static class Program
{
static Program()
{
AppDomainWrapper.Instance = new AppDomainWrapperInstance();
FileSystemWrapper.Instance = new FileSystemWrapperInstance();
TCPClientWrapper.Instance = new TCPClientWrapperInstance();
InputWrapper.Instance = new InputWrapperInstance();
ThreadWrapper.Instance = new ThreadWrapperInstance();
MineLib.Core.Extensions.PacketExtensions.Init();
}
public static void Main()
{
if (Type.GetType("Mono.Runtime") != null) // -- Running on Mono
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
using (var game = new Client(PlatformCode, false))
game.Run();
}
private static void PlatformCode(Game client)
{
client.Window.ClientSizeChanged += ((Client) client).OnResize;
client.IsMouseVisible = true;
client.Window.Position = new Point(0, 0);
client.Window.AllowUserResizing = true;
((Client) client).Resize(new Point(GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height));
//((Client) client).PreferredBackBufferWidth = 1440;
//((Client) client).PreferredBackBufferHeight = 900;
//((Client) client).PreferredBackBufferWidth = 800;
//((Client) client).PreferredBackBufferHeight = 600;
}
}
}