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

📄 frmdirectx.cs

📁 Beginning C# Game Programming 的源代码
💻 CS
📖 第 1 页 / 共 2 页
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using Microsoft.DirectX.Direct3D;

namespace EnterDirectX {
	/// <summary>
	/// Summary description for FrmDirectX.
	/// </summary>
	public class FrmDirectX : System.Windows.Forms.Form {
		internal System.Windows.Forms.Button CmdClose;
		internal System.Windows.Forms.Button CmdTransparency;
		internal System.Windows.Forms.Button CmdLight;
		internal System.Windows.Forms.Button CmdMatrix;
		internal System.Windows.Forms.Button CmdFullScreen;
		internal System.Windows.Forms.Button CmdWindow;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;
		private System.Windows.Forms.ListBox AdaptersListBox;
		private System.Windows.Forms.ListBox DevicesListBox;
		private System.Windows.Forms.ListBox DisplayModesListBox;
		private System.Windows.Forms.ListBox DeviceCapsListBox;
		private System.Windows.Forms.Label DeviceCapsLabel;
		private System.Windows.Forms.Label ResolutionsLabel;
		private System.Windows.Forms.Label DevicesLabel;
		private System.Windows.Forms.Label AdaptersLabel;
		internal System.Windows.Forms.GroupBox TestsGroup;

		Device device;

		public FrmDirectX() {
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing ) {
			if( disposing ) {
				if(components != null) {
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent() {
			this.CmdClose = new System.Windows.Forms.Button();
			this.AdaptersListBox = new System.Windows.Forms.ListBox();
			this.DevicesListBox = new System.Windows.Forms.ListBox();
			this.DisplayModesListBox = new System.Windows.Forms.ListBox();
			this.DeviceCapsLabel = new System.Windows.Forms.Label();
			this.ResolutionsLabel = new System.Windows.Forms.Label();
			this.DevicesLabel = new System.Windows.Forms.Label();
			this.AdaptersLabel = new System.Windows.Forms.Label();
			this.DeviceCapsListBox = new System.Windows.Forms.ListBox();
			this.TestsGroup = new System.Windows.Forms.GroupBox();
			this.CmdTransparency = new System.Windows.Forms.Button();
			this.CmdLight = new System.Windows.Forms.Button();
			this.CmdMatrix = new System.Windows.Forms.Button();
			this.CmdFullScreen = new System.Windows.Forms.Button();
			this.CmdWindow = new System.Windows.Forms.Button();
			this.TestsGroup.SuspendLayout();
			this.SuspendLayout();
			// 
			// CmdClose
			// 
			this.CmdClose.Location = new System.Drawing.Point(536, 296);
			this.CmdClose.Name = "CmdClose";
			this.CmdClose.Size = new System.Drawing.Size(88, 29);
			this.CmdClose.TabIndex = 34;
			this.CmdClose.Text = "Close";
			this.CmdClose.Click += new System.EventHandler(this.CmdClose_Click);
			// 
			// AdaptersListBox
			// 
			this.AdaptersListBox.Location = new System.Drawing.Point(8, 32);
			this.AdaptersListBox.Name = "AdaptersListBox";
			this.AdaptersListBox.Size = new System.Drawing.Size(160, 95);
			this.AdaptersListBox.TabIndex = 35;
			this.AdaptersListBox.SelectedIndexChanged += new System.EventHandler(this.AdaptersListBox_SelectedIndexChanged);
			// 
			// DevicesListBox
			// 
			this.DevicesListBox.Location = new System.Drawing.Point(8, 160);
			this.DevicesListBox.Name = "DevicesListBox";
			this.DevicesListBox.Size = new System.Drawing.Size(160, 95);
			this.DevicesListBox.TabIndex = 36;
			this.DevicesListBox.SelectedIndexChanged += new System.EventHandler(this.DevicesListBox_SelectedIndexChanged);
			// 
			// DisplayModesListBox
			// 
			this.DisplayModesListBox.HorizontalScrollbar = true;
			this.DisplayModesListBox.Location = new System.Drawing.Point(8, 288);
			this.DisplayModesListBox.Name = "DisplayModesListBox";
			this.DisplayModesListBox.Size = new System.Drawing.Size(160, 95);
			this.DisplayModesListBox.TabIndex = 37;
			// 
			// DeviceCapsLabel
			// 
			this.DeviceCapsLabel.AutoSize = true;
			this.DeviceCapsLabel.BackColor = System.Drawing.Color.Transparent;
			this.DeviceCapsLabel.Cursor = System.Windows.Forms.Cursors.Default;
			this.DeviceCapsLabel.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.DeviceCapsLabel.ForeColor = System.Drawing.SystemColors.ControlText;
			this.DeviceCapsLabel.Location = new System.Drawing.Point(184, 8);
			this.DeviceCapsLabel.Name = "DeviceCapsLabel";
			this.DeviceCapsLabel.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.DeviceCapsLabel.Size = new System.Drawing.Size(101, 16);
			this.DeviceCapsLabel.TabIndex = 29;
			this.DeviceCapsLabel.Text = "Device Capabilities:";
			// 
			// ResolutionsLabel
			// 
			this.ResolutionsLabel.AutoSize = true;
			this.ResolutionsLabel.BackColor = System.Drawing.Color.Transparent;
			this.ResolutionsLabel.Cursor = System.Windows.Forms.Cursors.Default;
			this.ResolutionsLabel.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.ResolutionsLabel.ForeColor = System.Drawing.SystemColors.ControlText;
			this.ResolutionsLabel.Location = new System.Drawing.Point(8, 264);
			this.ResolutionsLabel.Name = "ResolutionsLabel";
			this.ResolutionsLabel.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.ResolutionsLabel.Size = new System.Drawing.Size(79, 16);
			this.ResolutionsLabel.TabIndex = 28;
			this.ResolutionsLabel.Text = "Display Modes:";
			// 
			// DevicesLabel
			// 
			this.DevicesLabel.AutoSize = true;
			this.DevicesLabel.BackColor = System.Drawing.Color.Transparent;
			this.DevicesLabel.Cursor = System.Windows.Forms.Cursors.Default;
			this.DevicesLabel.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.DevicesLabel.ForeColor = System.Drawing.SystemColors.ControlText;
			this.DevicesLabel.Location = new System.Drawing.Point(3, 141);
			this.DevicesLabel.Name = "DevicesLabel";
			this.DevicesLabel.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.DevicesLabel.TabIndex = 27;
			this.DevicesLabel.Text = "Rendering Devices:";
			// 
			// AdaptersLabel
			// 
			this.AdaptersLabel.AutoSize = true;
			this.AdaptersLabel.BackColor = System.Drawing.Color.Transparent;
			this.AdaptersLabel.Cursor = System.Windows.Forms.Cursors.Default;
			this.AdaptersLabel.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.AdaptersLabel.ForeColor = System.Drawing.SystemColors.ControlText;
			this.AdaptersLabel.Location = new System.Drawing.Point(8, 8);
			this.AdaptersLabel.Name = "AdaptersLabel";
			this.AdaptersLabel.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.AdaptersLabel.Size = new System.Drawing.Size(51, 16);
			this.AdaptersLabel.TabIndex = 26;
			this.AdaptersLabel.Text = "Adapters:";
			// 
			// DeviceCapsListBox
			// 
			this.DeviceCapsListBox.BackColor = System.Drawing.SystemColors.Window;
			this.DeviceCapsListBox.Cursor = System.Windows.Forms.Cursors.Default;
			this.DeviceCapsListBox.Font = new System.Drawing.Font("Verdana", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.DeviceCapsListBox.ForeColor = System.Drawing.SystemColors.WindowText;
			this.DeviceCapsListBox.HorizontalScrollbar = true;
			this.DeviceCapsListBox.ItemHeight = 12;
			this.DeviceCapsListBox.Location = new System.Drawing.Point(184, 32);
			this.DeviceCapsListBox.Name = "DeviceCapsListBox";
			this.DeviceCapsListBox.RightToLeft = System.Windows.Forms.RightToLeft.No;
			this.DeviceCapsListBox.Size = new System.Drawing.Size(336, 352);
			this.DeviceCapsListBox.TabIndex = 30;
			// 
			// TestsGroup
			// 
			this.TestsGroup.Controls.Add(this.CmdTransparency);
			this.TestsGroup.Controls.Add(this.CmdLight);
			this.TestsGroup.Controls.Add(this.CmdMatrix);
			this.TestsGroup.Controls.Add(this.CmdFullScreen);
			this.TestsGroup.Controls.Add(this.CmdWindow);
			this.TestsGroup.Location = new System.Drawing.Point(528, 32);
			this.TestsGroup.Name = "TestsGroup";
			this.TestsGroup.Size = new System.Drawing.Size(106, 233);
			this.TestsGroup.TabIndex = 35;
			this.TestsGroup.TabStop = false;
			this.TestsGroup.Text = "Tests";
			// 
			// CmdTransparency
			// 
			this.CmdTransparency.Location = new System.Drawing.Point(13, 104);
			this.CmdTransparency.Name = "CmdTransparency";
			this.CmdTransparency.Size = new System.Drawing.Size(87, 37);
			this.CmdTransparency.TabIndex = 28;
			this.CmdTransparency.Text = "Transparency";
			this.CmdTransparency.Click += new System.EventHandler(this.CmdTransparency_Click);
			// 
			// CmdLight
			// 
			this.CmdLight.Location = new System.Drawing.Point(13, 187);
			this.CmdLight.Name = "CmdLight";
			this.CmdLight.Size = new System.Drawing.Size(87, 29);
			this.CmdLight.TabIndex = 27;
			this.CmdLight.Text = "Light";
			this.CmdLight.Click += new System.EventHandler(this.CmdLight_Click);
			// 
			// CmdMatrix
			// 
			this.CmdMatrix.Location = new System.Drawing.Point(13, 150);
			this.CmdMatrix.Name = "CmdMatrix";
			this.CmdMatrix.Size = new System.Drawing.Size(87, 28);
			this.CmdMatrix.TabIndex = 26;
			this.CmdMatrix.Text = "Matrix ";
			this.CmdMatrix.Click += new System.EventHandler(this.CmdMatrix_Click);
			// 
			// CmdFullScreen
			// 
			this.CmdFullScreen.Location = new System.Drawing.Point(13, 66);
			this.CmdFullScreen.Name = "CmdFullScreen";
			this.CmdFullScreen.Size = new System.Drawing.Size(87, 29);
			this.CmdFullScreen.TabIndex = 25;
			this.CmdFullScreen.Text = "Full Screen";
			this.CmdFullScreen.Click += new System.EventHandler(this.CmdFullScreen_Click);
			// 
			// CmdWindow
			// 
			this.CmdWindow.Location = new System.Drawing.Point(13, 27);
			this.CmdWindow.Name = "CmdWindow";
			this.CmdWindow.Size = new System.Drawing.Size(87, 27);
			this.CmdWindow.TabIndex = 24;
			this.CmdWindow.Text = "Window";
			this.CmdWindow.Click += new System.EventHandler(this.CmdWindow_Click);
			// 
			// FrmDirectX
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(640, 398);
			this.Controls.Add(this.CmdClose);
			this.Controls.Add(this.AdaptersListBox);
			this.Controls.Add(this.DevicesListBox);
			this.Controls.Add(this.DisplayModesListBox);
			this.Controls.Add(this.DeviceCapsLabel);
			this.Controls.Add(this.ResolutionsLabel);
			this.Controls.Add(this.DevicesLabel);
			this.Controls.Add(this.AdaptersLabel);
			this.Controls.Add(this.DeviceCapsListBox);
			this.Controls.Add(this.TestsGroup);
			this.Name = "FrmDirectX";
			this.Text = "FrmDirectX";
			this.Closing += new System.ComponentModel.CancelEventHandler(this.FrmDirectX_Closing);
			this.Load += new System.EventHandler(this.FrmDirectX_Load);
			this.TestsGroup.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion


		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() {
			Application.Run(new FrmDirectX());
		}

⌨️ 快捷键说明

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