Esempio n. 1
0
		public AGSGameSettings(string title, AGS.API.Size virtualResolution, WindowState windowState = WindowState.Maximized,
               AGS.API.Size? windowSize = null, VsyncMode vsync = VsyncMode.Adaptive, bool preserveAspectRatio = true,
                               WindowBorder windowBorder = WindowBorder.Resizable)
		{
            Title = title;
            VirtualResolution = virtualResolution;
            WindowState = windowState;
            WindowSize = windowSize.HasValue ? windowSize.Value : virtualResolution;
            Vsync = vsync;
            PreserveAspectRatio = preserveAspectRatio;
            WindowBorder = windowBorder;
		}
Esempio n. 2
0
 public AGSGameSettings(string title, AGS.API.Size virtualResolution, WindowState windowState = WindowState.Maximized,
                        AGS.API.Size?windowSize   = null, VsyncMode vsync = VsyncMode.Adaptive, bool preserveAspectRatio = true,
                        WindowBorder windowBorder = WindowBorder.Resizable)
 {
     Title               = title;
     VirtualResolution   = virtualResolution;
     WindowState         = windowState;
     WindowSize          = windowSize.HasValue ? windowSize.Value : virtualResolution;
     Vsync               = vsync;
     PreserveAspectRatio = preserveAspectRatio;
     WindowBorder        = windowBorder;
 }
Esempio n. 3
0
    public void SetVSyncMode(float modeValueOffset)
    {
        float modeValue = modeValueOffset;

        if (modeValue < 1 || modeValue > System.Enum.GetNames(typeof(VsyncMode)).Length)
        {
            Debug.LogWarning("Invalid VSync Mode");
            return;
        }

        targetFrameRate = (VsyncMode)modeValue;
        UpdateVSyncMode();
    }
Esempio n. 4
0
        public AGSGameSettings(string title, Size virtualResolution, WindowState windowState = WindowState.Maximized,
                               Size?windowSize           = null, VsyncMode vsync = VsyncMode.Adaptive, bool preserveAspectRatio = true,
                               WindowBorder windowBorder = WindowBorder.Resizable)
        {
            Title               = title;
            VirtualResolution   = virtualResolution;
            WindowState         = windowState;
            WindowSize          = windowSize.HasValue ? windowSize.Value : virtualResolution;
            Vsync               = vsync;
            PreserveAspectRatio = preserveAspectRatio;
            WindowBorder        = windowBorder;
            var fonts   = new AGSDefaultFonts();
            var dialogs = new AGSDialogSettings(AGSGame.Device, fonts);

            Defaults = new AGSDefaultsSettings(fonts, dialogs);
        }
Esempio n. 5
0
    /// <summary>
    /// Check input and switch between target frame rates
    /// These samples use the default Unity Input Mappings with the addition of "Right Shoulder" and "Left Shoulder"
    /// </summary>
    void Update()
    {
        if (Input.GetButtonDown("RightShoulder"))
        {
            //*************************
            // switch to the next mode
            //*************************
            switch (targetFrameRate)
            {
            case VsyncMode.VSYNC_20FPS:
                targetFrameRate = VsyncMode.VSYNC_30FPS;
                break;

            case VsyncMode.VSYNC_30FPS:
                targetFrameRate = VsyncMode.VSYNC_60FPS;
                break;

            case VsyncMode.VSYNC_60FPS:
                targetFrameRate = VsyncMode.VSYNC_20FPS;
                break;
            }
            UpdateVSyncMode();
        }
        else if (Input.GetButtonDown("LeftShoulder"))
        {
            //*************************
            // switch to the previous mode
            //*************************
            switch (targetFrameRate)
            {
            case VsyncMode.VSYNC_20FPS:
                targetFrameRate = VsyncMode.VSYNC_60FPS;
                break;

            case VsyncMode.VSYNC_30FPS:
                targetFrameRate = VsyncMode.VSYNC_20FPS;
                break;

            case VsyncMode.VSYNC_60FPS:
                targetFrameRate = VsyncMode.VSYNC_30FPS;
                break;
            }
            UpdateVSyncMode();
        }
    }
    /// <summary>
    /// Check input and switch between target frame rates
    /// These samples use the default Unity Input Mappings with the addition of "Right Shoulder" and "Left Shoulder"
    /// </summary>
    void Update()
    {
        if (OVRInput.GetDown(button))
        {
            //*************************
            // switch to the next mode
            //*************************
            switch (targetFrameRate)
            {
            case VsyncMode.VSYNC_20FPS:
                targetFrameRate = VsyncMode.VSYNC_30FPS;
                break;

            case VsyncMode.VSYNC_30FPS:
                targetFrameRate = VsyncMode.VSYNC_60FPS;
                break;

            case VsyncMode.VSYNC_60FPS:
                targetFrameRate = VsyncMode.VSYNC_20FPS;
                break;
            }
            UpdateVSyncMode();
        }
    }
Esempio n. 7
0
 /// <summary>
 /// Check input and switch between target frame rates
 /// These samples use the default Unity Input Mappings with the addition of "Right Shoulder" and "Left Shoulder"
 /// </summary>
 void Update()
 {
     if (Input.GetButtonDown("RightShoulder"))
     {
         //*************************
         // switch to the next mode
         //*************************
         switch(targetFrameRate)
         {
         case VsyncMode.VSYNC_20FPS:
             targetFrameRate = VsyncMode.VSYNC_30FPS;
             break;
         case VsyncMode.VSYNC_30FPS:
             targetFrameRate = VsyncMode.VSYNC_60FPS;
             break;
         case VsyncMode.VSYNC_60FPS:
             targetFrameRate = VsyncMode.VSYNC_20FPS;
             break;
         }
         UpdateVSyncMode();
     }
     else if (Input.GetButtonDown("LeftShoulder"))
     {
         //*************************
         // switch to the previous mode
         //*************************
         switch(targetFrameRate)
         {
         case VsyncMode.VSYNC_20FPS:
             targetFrameRate = VsyncMode.VSYNC_60FPS;
             break;
         case VsyncMode.VSYNC_30FPS:
             targetFrameRate = VsyncMode.VSYNC_20FPS;
             break;
         case VsyncMode.VSYNC_60FPS:
             targetFrameRate = VsyncMode.VSYNC_30FPS;
             break;
         }
         UpdateVSyncMode();
     }
 }
Esempio n. 8
0
 private static extern void OVR_TW_SetMinimumVsyncs( VsyncMode mode );
 private static extern void OVR_TW_SetMinimumVsyncs(VsyncMode mode);