tencent cloud

Feedback

Adaptive Resolution

Last updated: 2024-01-26 11:54:09
    This document describes how to support adaptive resolution for cloud applications. This feature can be used to make an application adapt to different client resolutions and achieve a fullscreen display without black bars.

    Sequence diagram

    

    Directions

    Recommended method

    1. Prerequisites:
    1.1 Before you upload an application to CAR, we recommend you first set the application to borderless windowed fullscreen mode and enable adaptive resolution.
    Note:
    This operation must be done by adjusting settings within the application.
    For applications built with Unreal Engine, you can add the blueprint below to your Map's BeginPlay to enable adaptive desktop resolution. Make sure In Fullscreen Mode is configured as Windowed Fullscreen.
    
    The applications built with ‌Unity can be configured to borderless windowed fullscreen mode as shown below.
    
    It can also be configured by adding the application startup parameter -screen-fullscreen 1. For detailed parameters of Unity applications, see here.
    
    For some applications, the display mode can be adjusted in the application settings. After adjusting the settings, you can update the application version in the console.
    
    An application is NOT in the borderless windowed mode when displayed in the exclusive fullscreen mode. In CAR, adaptive resolution is achieved by modifying the cloud desktop resolution. An application in exclusive fullscreen mode has full control over the display resolution. In this case, a crash may occur when the display resolution is modified.
    How to differentiate between borderless windowed mode and exclusive fullscreen mode? Press Alt+Tab to switch to a different window. Borderless windowed applications do not cause the display to flicker when the window is switched, while exclusive fullscreen applications do cause the display to flicker.
    1.2 In the CAR console, go to the application configuration and set the screen capture mode to Capture the entire desktop.
    2. The business client calls the TCGSDK.start() API to start the cloud application. After it connects to the application, the onConnectSuccess() callback is triggered. We recommend you set the resolution for the client after this callback.
    3. The business client calls the TCGSDK.getPageSize() API or other methods to get the client resolution.
    4. After getting the resolution, the client calls the TCGSDK.setRemoteDesktopResolution() API to set the cloud resolution.
    5. After the request to set the resolution is received in the cloud, the cloud desktop resolution is modified, and the cloud application adapts to the resolution change.
    6. The business client calls the onRemoteScreenResolutionChange() API to check whether the resolution settings have taken effect.

    Adapting to different client resolutions if the application is only displayed in a non-fullscreen window (not recommended)

    If your application is only displayed in a non-fullscreen window and cannot be set to borderless windowed fullscreen mode, you can go to the application configuration in the console to set the screen capture mode to Capture a window. You need to fill in the correct application window title and class name as described in Using Window Capturing Mode. If the window title is not specified during development, the window title after starting Demo.exe is usually “Demo”; if your application is developed with Unreal Engine, the class name is usually “UnrealWindow”.
    Next steps:
    1. The business client calls the TCGSDK.start() API to start the cloud application. After it connects to the application, the onConnectSuccess() callback is triggered. We recommend you set the resolution for the client after this callback.
    2. The business client calls the TCGSDK.getPageSize() API or other methods to get the client resolution.
    3. The business client notifies the cloud application to modify the resolution through a data channel or by using a custom method.
    4. After the request to set the resolution is received in the cloud, the cloud desktop resolution is then modified. (This requires support by the application)
    5. Since the display resolution of the application changes, to avoid problems such as incomplete display, partial screen unresponsiveness, and other issues caused by the application resolution exceeding the cloud desktop resolution, make sure the cloud desktop resolution is always greater than the application resolution by using one of the following methods:
    Method 1: In the console, go to Project settings > Advanced settings and change the default cloud desktop resolution to a sufficiently large size, such as 2500 x 2500.
    Method 2: Synchronously call the TCGSDK.setRemoteDesktopResolution() API to modify the cloud desktop resolution. The business client calls the onRemoteScreenResolutionChange() API to check whether the resolution settings have taken effect.
    Note:
    The methods above are relatively complicated, and improper configuration may cause issues such as incomplete screen display, partial screen unresponsiveness, and abnormal client screen resolution. Therefore, we recommend you use the recommended method of setting the application to borderless windowed mode and enabling adaptive resolution.
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support