Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.35 KB | None | 0 0
  1. //Case 1: when i click back button on my pad
  2.  
  3.         private void HandleInputEvents(ButtonEventArgs args)
  4.         {
  5.             //For testing purposes..only PlayerIndex One is valid
  6.             if (args.PlayerIndex != 0)
  7.                 return;
  8.  
  9.             if (args.EventType == KeyButtonState.Clicked)
  10.             {
  11.                 //Back
  12.                 if (args.ButtonsList.Contains(32))
  13.                     Root.Instance.QueueEndRendering();
  14. [...]
  15.  
  16. //Case 2: the window was closed..this code is from my WindowEventListener
  17.  
  18.         #region WindowClosed
  19.         /// <summary>
  20.         /// Window has closed
  21.         /// </summary>
  22.         /// <param name="rw">The RenderWindow which created this event</param>
  23.         public void WindowClosed(RenderWindow rw)
  24.         {
  25.             Contract.RequiresNotNull(rw, "RenderWindow");
  26.  
  27.             // Only do this for the Main Window
  28.             if (rw == EngineCore.Instance.RenderWindow)
  29.                 Root.Instance.QueueEndRendering();
  30.         }
  31.         #endregion
  32.  
  33. //Case 3: When i send the quit command from the console:
  34.  
  35.         #region Quit
  36.         /// <summary>
  37.         ///
  38.         /// </summary>
  39.         internal static int Quit(params string[] args)
  40.         {
  41.             Root.Instance.QueueEndRendering();
  42.             return 0;
  43.         }
  44.         #endregion Quit
  45.  
  46. //and that's all
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement