os_get_info

This function returns a DS Map with detailed information about the OS that the game is running on. The exact information returned will depend on the OS and the device, so it is recommended that you test this function on all platforms that you wish to target and output the returned values using a function like show_debug_message(). Note that the DS map is not automatically cleared from memory and you should use the ds_map_destroy() function when you no longer need it.

Below you can find some details on the extra data that will be made available to the DS map specific to the following platforms, and it should be noted that on all platforms except HTML5 the map will have the key "is64bit" which will either be true or false depending on whether the runner is running in 64-bit mode or not.

WindowsWindows

On Windows, you will get some extra data from DX11 with the following keys available in the DS map (useful for extensions):

 

macOSmacOS

The function returns some limited OpenGL information on macOS:

 

UbuntuUbuntu

This contains the same information as on macOS.

 

AndroidAndroid

On the Android platform you will get some extra data from various different APIs with the following keys available in the DS map:

NOTE For information on any android.os.Build variables, see the Android Developer documentation.

 

iOS & tvOSiOS & tvOS

Here are the keys returned on iOS and tvOS (for detailed information, please refer to the Apple Developer documentation):

GX.gamesGX.games

The following extra keys will be included in the DS Map for GX.games:

HTML5HTML5

Returns -1.

Nintendo SwitchNintendo Switch

Returns -1.

PlayStation 4PlayStation 4

Please refer to the PS4 documentation for information on the functions referenced here.

The function returns the following keys on a PlayStation 4 console:

 

PlayStation 5PlayStation 5      

The function returns the following keys on a PlayStation 5 console:


Xbox One & Series X/SXbox One & Series X/S

The info returned on Xbox One and Xbox Series X/S is mostly the same as Windows, however the video_adapter_* and udid keys are 0 (except for video_adapter_description which is an empty string ""). It also does not have the video_d3d11_swapchain key and the video_d3d11_* keys have been replaced by video_d3d12_*.

Here are some keys that this platform returns in addition to the ones listed under Windows: 

 

Syntax:

os_get_info()

 

Returns:

DS Map

 

Example:

if (os_type == os_android)
{
    var _info = os_get_info();
    
    if (_info[? "android_tv"])
    {
        global.android_tv = true;
    }
}

The above code checks if the current OS is Android, gets the OS info and reads the returned map to check if the game is running on an Android TV; in that case it sets the custom variable global.android_tv to true.