コード例 #1
0
        /// <summary>
        /// Handles a frame of the main game loop.
        /// </summary>
        void HandleFrame()
        {
            try
            {
                // If the game has not been created yet, just don't do anything
                if (_game == null)
                {
                    return;
                }

                // If the game is running, handle the next frame. Otherwise, close the form.
                if (!_game.IsDisposed)
                {
                    _game.HandleFrame();
                }
                else
                {
                    Close();
                }
            }
            catch (Exception ex)
            {
                ExceptionSwallower.Instance.Swallow(ex);
                if (ExceptionSwallower.Instance.Rethrow)
                {
                    throw;
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Handles a frame of the main game loop.
        /// </summary>
        void HandleFrame()
        {
            //TODO: find out why exception swalloer causes issues
            // try
            // {
            // If the game has not been created yet, just don't do anything
            if (_game == null)
            {
                return;
            }

            // If the game is running, handle the next frame. Otherwise, close the form.
            if (!_game.IsDisposed)
            {
                _game.HandleFrame();
            }
            else
            {
                Close();
            }
            // }
            // catch (Exception ex)
            //{
            //   ExceptionSwallower.Instance.Swallow(ex);
            //  if (ExceptionSwallower.Instance.Rethrow)
            //     throw;
            // }
        }