OpenTK.DisplayDevice.RestoreResolution C# (CSharp) Method

RestoreResolution() public method

Restores the original resolution of the DisplayDevice.
Thrown if the original resolution could not be restored.
public RestoreResolution ( ) : void
return void
        public void RestoreResolution()
        {
            if (original_resolution != null)
            {
                //effect.FadeOut();

                if (implementation.TryRestoreResolution(this))
                {
                    current_resolution = original_resolution;
                    original_resolution = null;
                }
                else throw new Graphics.GraphicsModeException(String.Format("Device {0}: Failed to restore resolution.", this));

                //effect.FadeIn();
            }
        }

Usage Example

Ejemplo n.º 1
0
 /// <summary>
 /// Releases all non-managed resources belonging to this NativeWindow.
 /// </summary>
 public virtual void Dispose()
 {
     if (!IsDisposed)
     {
         if ((options & GameWindowFlags.Fullscreen) != 0)
         {
             //if (WindowState == WindowState.Fullscreen) WindowState = WindowState.Normal; // TODO: Revise.
             device.RestoreResolution();
         }
         implementation.Dispose();
         GC.SuppressFinalize(this);
         IsDisposed = true;
     }
 }
All Usage Examples Of OpenTK.DisplayDevice::RestoreResolution