sdlGetDeviceFormFactor function system

int sdlGetDeviceFormFactor()

Get the form factor of the current device.

This function guesses what the device may be, but may report inaccurate or outright wrong results. For example, it may report a laptop as a desktop, or a car device as a phone.

Depending on the usage, there may be different functions better suited for each purpose. For example, activating touch controls can be done by detecting the presence of a touchscreen rather than restricting to phones and tablets.

\returns the best guess for the form factor of the current device.

\since This function is available since SDL 3.6.0.

\sa SDL_FormFactor \sa SDL_GetDeviceFormFactorName

extern SDL_DECLSPEC SDL_FormFactor SDLCALL SDL_GetDeviceFormFactor(void)

Implementation

int sdlGetDeviceFormFactor() {
  final sdlGetDeviceFormFactorLookupFunction = _libSdl
      .lookupFunction<Int32 Function(), int Function()>(
        'SDL_GetDeviceFormFactor',
      );
  return sdlGetDeviceFormFactorLookupFunction();
}