⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cs

📁 《.NET游戏编程入门经典-c#篇》
💻 CS
字号:
using System;
using System.Drawing;
using Microsoft.DirectX;
using Container = System.ComponentModel.Container;


	/// <summary>
	/// The main windows form for the application.
	/// </summary>
public class MainClass {

	private GameClass game = null;
	private SplashScreen splash = null;
	private bool enableNetwork = false;
	public bool EnableNetwork { get { return enableNetwork; } set { enableNetwork = value; } }

	private Size gameFormSize;
	public Size GameFormSize { get { return gameFormSize; } set { gameFormSize = value; } }

	private bool fullScreen = false;
	public bool FullScreen { get { return fullScreen; } set { fullScreen = value; } }

	/// <summary>
	// Main entry point of the application.
	/// </summary>
	public static void Main() {
		MainClass m = new MainClass();
	}

	public MainClass() {

		//display the splash screen and determine network status
		splash = new SplashScreen(this);
		splash.ShowDialog();

		try {
			game = new GameClass(fullScreen, gameFormSize, enableNetwork);
		}
		catch(DirectXException) {
			return;
		}
		if( game.CreateGraphicsSample() )
			game.Run();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -