SDL Wiki
[ front page | index | search | recent changes | git repo | offline html ]

SDL_GetDeviceFormFactor

Get the form factor of the current device.

Header File

Defined in <SDL3/SDL_system.h>

Syntax

SDL_FormFactor SDL_GetDeviceFormFactor(void);

Return Value

(SDL_FormFactor) Returns the best guess for the form factor of the current device.

Remarks

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.

Version

This function is available since SDL 3.6.0.

See Also


CategoryAPI, CategoryAPIFunction, CategorySystem


[ edit | delete | history | feedback | raw ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.