public void Initialise() { Services.ForAll(service => service.Init()); GameObject cameraObject = this.CreateGameObject(); this.MainCamera = cameraObject.AddComponent <Camera>(); GraphicsServices.GetService <RenderForm>().FormClosed += (_, __) => this.Dispose(); this.IsInitialised = true; }
public void Run() { if (this.IsInitialised == false) { throw new InvalidOperationException("Engine not initialised."); } RenderLoop.Run(GraphicsServices.GetService <RenderForm>(), () => { this.Update(); this.Render(); }); }