sdlGetDeviceFormFactorName function system
Get a short name for the current device.
The name will be in English.
\param form_factor the form factor to query. \returns a human-readable name for the given form factor, or "SDL_FORMFACTOR_UNKNOWN" if the form factor isn't recognized.
\since This function is available since SDL 3.6.0.
\sa SDL_FormFactor \sa SDL_GetDeviceFormFactor
extern SDL_DECLSPEC const char* SDLCALL SDL_GetDeviceFormFactorName(SDL_FormFactor form_factor)
Implementation
String? sdlGetDeviceFormFactorName(int formFactor) {
final sdlGetDeviceFormFactorNameLookupFunction = _libSdl
.lookupFunction<
Pointer<Utf8> Function(Int32 formFactor),
Pointer<Utf8> Function(int formFactor)
>('SDL_GetDeviceFormFactorName');
final result = sdlGetDeviceFormFactorNameLookupFunction(formFactor);
if (result == nullptr) {
return null;
}
return result.toDartString();
}