/// <summary> /// Gets the system handle to use to display the game on when using windowed mode. If <see cref="IntPtr.Zero"/> is returned, /// a system form will be created automatically. /// </summary> /// <param name="displayContainer">When this method returns a value other than <see cref="IntPtr.Zero"/>, contains the /// object that the returned system handle belongs to. This is then later used in other virutal methods to initialize /// and dispose the container at the appropriate times.</param> /// <returns> /// The handle to the custom control to display the game on, or <see cref="IntPtr.Zero"/> to create the window /// to display the game on internally. /// </returns> protected override IntPtr CreateWindowedDisplayHandle(out object displayContainer) { var frm = new GameForm(this); // Set form title while we're at it frm.Text = GameMessageCollection.CurrentLanguage.GetMessage(GameMessage.GameTitle); displayContainer = frm; return(frm.Handle); }
/// <summary> /// Gets the system handle to use to display the game on when using windowed mode. If <see cref="IntPtr.Zero"/> is returned, /// a system form will be created automatically. /// </summary> /// <param name="displayContainer">When this method returns a value other than <see cref="IntPtr.Zero"/>, contains the /// object that the returned system handle belongs to. This is then later used in other virutal methods to initialize /// and dispose the container at the appropriate times.</param> /// <returns> /// The handle to the custom control to display the game on, or <see cref="IntPtr.Zero"/> to create the window /// to display the game on internally. /// </returns> protected override IntPtr CreateWindowedDisplayHandle(out object displayContainer) { var frm = new GameForm(this); // Set form title while we're at it frm.Text = GameMessageCollection.CurrentLanguage.GetMessage(GameMessage.GameTitle); displayContainer = frm; return frm.Handle; }
/// <summary> /// Gets the system handle to use to display the game on when using windowed mode. If <see cref="IntPtr.Zero"/> is returned, /// a system form will be created automatically. /// </summary> /// <param name="displayContainer">When this method returns a value other than <see cref="IntPtr.Zero"/>, contains the /// object that the returned system handle belongs to. This is then later used in other virutal methods to initialize /// and dispose the container at the appropriate times.</param> /// <returns> /// The handle to the custom control to display the game on, or <see cref="IntPtr.Zero"/> to create the window /// to display the game on internally. /// </returns> protected override IntPtr CreateWindowedDisplayHandle(out object displayContainer) { var frm = new GameForm(this); displayContainer = frm; return frm.Handle; }