Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Case 1: when i click back button on my pad
- private void HandleInputEvents(ButtonEventArgs args)
- {
- //For testing purposes..only PlayerIndex One is valid
- if (args.PlayerIndex != 0)
- return;
- if (args.EventType == KeyButtonState.Clicked)
- {
- //Back
- if (args.ButtonsList.Contains(32))
- Root.Instance.QueueEndRendering();
- [...]
- //Case 2: the window was closed..this code is from my WindowEventListener
- #region WindowClosed
- /// <summary>
- /// Window has closed
- /// </summary>
- /// <param name="rw">The RenderWindow which created this event</param>
- public void WindowClosed(RenderWindow rw)
- {
- Contract.RequiresNotNull(rw, "RenderWindow");
- // Only do this for the Main Window
- if (rw == EngineCore.Instance.RenderWindow)
- Root.Instance.QueueEndRendering();
- }
- #endregion
- //Case 3: When i send the quit command from the console:
- #region Quit
- /// <summary>
- ///
- /// </summary>
- internal static int Quit(params string[] args)
- {
- Root.Instance.QueueEndRendering();
- return 0;
- }
- #endregion Quit
- //and that's all
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement