sdlGpuSupportsShaderFormats function
Checks for GPU runtime support.
\param format_flags a bitflag indicating which shader formats the app is able to provide. \param name the preferred GPU driver, or NULL to let SDL pick the optimal driver. \returns true if supported, false otherwise.
\since This function is available since SDL 3.1.3.
\sa SDL_CreateGPUDevice
extern SDL_DECLSPEC bool SDLCALL SDL_GPUSupportsShaderFormats( SDL_GPUShaderFormat format_flags, const char *name)
Implementation
bool sdlGpuSupportsShaderFormats(int formatFlags, String? name) {
final sdlGpuSupportsShaderFormatsLookupFunction = libSdl3.lookupFunction<
Uint8 Function(Uint32 formatFlags, Pointer<Utf8> name),
int Function(
int formatFlags, Pointer<Utf8> name)>('SDL_GPUSupportsShaderFormats');
final namePointer = name != null ? name.toNativeUtf8() : nullptr;
final result =
sdlGpuSupportsShaderFormatsLookupFunction(formatFlags, namePointer) == 1;
calloc.free(namePointer);
return result;
}