os_get_info


Description

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. 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 for specific platforms:

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):

  • video_d3d11_device - pointer to the DX11 device

  • video_d3d11_context - pointer to the DX11 context

  • video_adapter_vendorid - string with the adapters vendor id

  • video_adapter_deviceid - string with the adapter device id

  • video_adapter_subsysid - string with the adapter sub system id

  • video_adapter_revision - string with the adapter revision number

  • video_adapter_dedicatedvideomemory - string with the size of the video memory

  • video_adapter_dedicatedsystemmemory - string with the size of the system memory (used by DX11 adapter)


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

  • android_tv - this will return true if the device is detected as being an Android TV device (or if you are compiling for the Amazon Fire target), or false otherwise

  • GL_VERSION - the version of OpenGL as reported by the driver

  • GL_VENDOR - the vendor of OpenGL as reported by the driver

  • GL_RENDERER - the renderer of OpenGL as reported by the driver

  • GL_EXTENSIONS - the extensions of OpenGL that are available as reported by the driver

  • GL_SHADING_LANGUAGE_VERSION - the version of the GLSL that is supported by this OpenGL driver

  • GL_MAX_TEXTURE_SIZE - the maximum texture size supported by this OpenGL driver

  • SDK_INT - value of android.os.Build.VERSION.SDK_INT see here for more information.

  • RELEASE - value of android.os.Build.VERSION.RELEASE see here for more information.

  • MODEL - value of android.os.Build.MODEL see here for more information.

  • DEVICE - value of android.os.Build.DEVICE see here for more information.

  • MANUFACTURER - value of android.os.Build.MANUFACTURER see here for more information.

  • CPU_ABI - value of android.os.Build.CPU_ABI see here for more information.

  • CPU_ABI2 - value of android.os.Build.CPU_ABI2 see here for more information.

  • BOOTLOADER - value of android.os.Build.BOOTLOADER see here for more information.

  • BOARD - value of android.os.Build.BOARD see here for more information.

  • VERSION - value of os.version from the Android System.getProperty method

  • REGION - values of user.region from the Android System.getProperty method

  • VERSION_NAME - value of this packages versionName - see here for more information.

  • PHYSICAL_KEYBOARD - if we think a physical keyboard is available then the string "TRUE" otherwise "FALSE"


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, key, i;
   size = ds_map_size(os_map);
   key = ds_map_find_first(os_map);
   for (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.