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 the data it contains.

Below you can find some details of extra information that will be made available to the DS map specific to the following platforms:

 

Windows / UWPWindows / UWP

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


Android / Amazon FireAndroid / Amazon Fire

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


 

NOTE: This function only works on Android, iOS, Mac, Ubuntu and Windows (Desktop + UWP), on all other target platforms it will return -1 rather than a DS Map.

 

Syntax:

os_get_info()

 

Returns:

Real (ds_map index)

 

Example:

os_map = os_get_info();
if (os_map != -1)
   {
   var size = ds_map_size(os_map);
   var key = ds_map_find_first(os_map);
   for (var i = 0; i < size - 1; i++;)
      {
      map_data[i] = ds_map_find_value(os_map, key);
      key = ds_map_find_next(os_map, key);
      }
   ds_map_destroy(os_map);
   }

The above code will check the OS information to see if a DS Map is returned. If it is, then the code will loop through the map and assign all the values to an array.