コード例 #1
0
 public Game1(ClientEngine eng)
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     //graphics.PreferredBackBufferWidth = 600;//1024;
     //graphics.PreferredBackBufferHeight = 480;//768;
     graphics.PreferredBackBufferWidth = 1024;
     graphics.PreferredBackBufferHeight = 768;
     gengine = eng;
     while (!eng.ready)
     {
         // horrible
     }
     environment = gengine.getEnvironment();
 }
コード例 #2
0
 private void bJoin_Click(object sender, EventArgs e)
 {
     // TODO : better handling of exception
     IPEndPoint server = new IPEndPoint(IPAddress.Parse(tbIp.Text), int.Parse(tbPort.Text));
     try
     {
         ClientEngine ci = new ClientEngine(server);
         Game1 game = new Game1(ci);
         game.Run();
     }
     catch (Exception exception)
     {
         Console.Out.WriteLine(exception.Message);
     }
 }
コード例 #3
0
 public ENetClient(ClientEngine ce)
 {
     engine = ce;
     client = new ENet.Host();
     client.InitializeClient(2); // 2 channels per client
 }