public void Start() { target = new System.Windows.Forms.Form(); target.Show(); target.Update(); ready = true; StartInternal(); PhysicsThread = new Thread(new ThreadStart(PhysicsLoop)); PhysicsThread.Name = "Physics thread"; RenderThread.Start(); PhysicsThread.Start(); MainLoop(); }
/// <summary> /// 允许绘制用户界面,一般表示文档更新完毕,可以绘制文档内容 /// </summary> public void EndUpdate() { intUpdateLevel--; if (intUpdateLevel < 0) { intUpdateLevel = 0; } if (intUpdateLevel <= 0) { if (myBindControl != null) { myBindControl.Update(); } if (Update != null) { Update(this, null); } } }
public void StartAsync() { target = new System.Windows.Forms.Form(); target.Show(); target.Update(); ready = true; StartInternal(); LogicThread = new System.Threading.Thread(new System.Threading.ThreadStart(MainLoop)); LogicThread.Name = "Logic thread"; PhysicsThread = new Thread(new ThreadStart(PhysicsLoop)); PhysicsThread.Name = "Physics thread"; RenderThread.Start(); LogicThread.Start(); PhysicsThread.Start(); }