-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathProgram.cs
43 lines (41 loc) · 1.36 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
using System.ComponentModel;
namespace dirPro
{
static class Program
{
//public double mouseZoom=0;
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
mainform = new Form1();
mainform.Show();//Application.Run(mainform);
while (mainform.Created) //设置一个循环用于实时更新渲染状态
{
if (mainform.finishReading)
{
/*
if (mainform.InitializeGraphics() == false) //检查Direct3D是否启动
{
MessageBox.Show("无法启动Direct3D!", "错误!");
return;
}*/
mainform.Render(); //保持device渲染,直到程序结束
}
Application.DoEvents(); //处理键盘鼠标等输入事件
}
}
public static Form1 mainform;
}
}