Ejemplo n.º 1
0
        protected void OnMove(object sender, EventArgs e)
        {
            if (inWindowModeTransition)
            {
                return;
            }
            if (WindowMode.Value == Configuration.WindowMode.Windowed)
            {
                // Values are clamped to a range of [-0.5, 1.5], so if more than half of the window was
                // outside of the combined screen area before the game was closed, it will be moved so
                // that at least half of it is on screen after a restart.
                windowPositionX.Value = Position.X;
                windowPositionY.Value = Position.Y;
            }

            windowDisplayIndex.Value = CurrentDisplay.GetIndex();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Converts an osuTK <see cref="DisplayDevice"/> to a <see cref="Display"/> structure.
 /// </summary>
 /// <param name="device">The <see cref="DisplayDevice"/> to convert.</param>
 /// <returns>A <see cref="Display"/> structure populated with the corresponding properties and <see cref="DisplayMode"/>s.</returns>
 internal static Display ToDisplay(this DisplayDevice device) =>
 new Display((int)device.GetIndex(), device.GetIndex().ToString(), device.Bounds, device.AvailableResolutions.Select(ToDisplayMode).ToArray());