Example #1
0
        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;
        }
Example #2
0
        public void Run()
        {
            if (this.IsInitialised == false)
            {
                throw new InvalidOperationException("Engine not initialised.");
            }

            RenderLoop.Run(GraphicsServices.GetService <RenderForm>(), () =>
            {
                this.Update();
                this.Render();
            });
        }