Scroll to navigation

SDL_GetDeviceFormFactor(3) SDL3 FUNCTIONS SDL_GetDeviceFormFactor(3)

NAME

SDL_GetDeviceFormFactor - Get the form factor of the current device.

SYNOPSIS

#include <SDL3/SDL_system.h>
SDL_FormFactor SDL_GetDeviceFormFactor(void);

DESCRIPTION

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.

RETURN VALUE

Returns the best guess for the form factor of the current device.

AVAILABILITY

This function is available since SDL 3.6.0.

SEE ALSO

SDL_FormFactor(3type), SDL_GetDeviceFormFactorName(3)

SDL 3.5.0 Simple Directmedia Layer