//------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------ public void Run() { this.InitDebug(); if (this.ActiveGame == null) throw new Exception("No active game defined."); Engine that = this; /*render cycle*/ SystemCore.Timer.RequestAnimationFrame(delegate { that.Graphics.Render(); }); this._cleanuphandle = SystemCore.Timer.Start(delegate { that.Library.Update(); }, 60000, true); this._updateHandle = SystemCore.Timer.Start(delegate { that.Update(); }, 1000 / 24, true); /*initialize graphics*/ this.Graphics.Initialize(45, 0.1f, 200.0f); this.Graphics.ViewOccluder = new ViewFrustrumOccluder(); /*initialize game*/ this.ActiveGame.Initialize(); /*initialize collision*/ this._b2World = new B2World(new B2Vec2(0.0f, 0.0f), true); }