sdlGetPixelFormatName function
Get the human readable name of a pixel format.
\param format the pixel format to query
\returns the human readable name of the specified pixel format or
SDL_PIXELFORMAT_UNKNOWN
if the format isn't recognized.
\since This function is available since SDL 2.0.0.
extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format)
Implementation
String? sdlGetPixelFormatName(int format) {
final sdlGetPixelFormatNameLookupFunction = libSdl2.lookupFunction<
Pointer<Utf8> Function(Uint32 format),
Pointer<Utf8> Function(int format)>('SDL_GetPixelFormatName');
final result = sdlGetPixelFormatNameLookupFunction(format);
if (result == nullptr) {
return null;
}
return result.toDartString();
}