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;
		}
Exemple #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;
 }
Exemple #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();
    }
        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);
        }
    /// <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();
        }
    }
 /// <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();
     }
 }
 private static extern void OVR_TW_SetMinimumVsyncs( VsyncMode mode );
 private static extern void OVR_TW_SetMinimumVsyncs(VsyncMode mode);