Exemple #1
0
        /// <summary>
        /// Call Game when your application's done. Disposes of Game and fires any
        /// OnGameTermination events.
        /// </summary>
        public static void Terminate()
        {
            if (Game.Terminated)
            {
                return;
            }

            if (AudioSystem != null)
            {
                AudioSystem.Dispose();
            }

            if (InputSystem.InputProvider != null)
            {
                InputSystem.InputProvider.Dispose();
            }

            if (RenderSystem != null)
            {
                RenderSystem.Dispose();
            }

            if (Game.OnGameTermination != null)
            {
                Game.OnGameTermination(null, Game.internedEventArg);
            }
            Game.Terminated = true;
            Unsubscribe(messenger);
        }